Skip to content

Commit f381018

Browse files
author
Thomas Reggi
committed
matts fix, rm 3.6 code
1 parent d75b406 commit f381018

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

lib/connection_string.js

-8
Original file line numberDiff line numberDiff line change
@@ -720,14 +720,6 @@ function parseConnectionString(uri, options, callback) {
720720
return callback(new MongoParseError('directConnection option requires exactly one host'));
721721
}
722722

723-
// NOTE: this behavior will go away in v4.0, we will always auto discover there
724-
if (
725-
parsedOptions.directConnection == null &&
726-
hosts.length === 1 &&
727-
parsedOptions.replicaSet == null
728-
) {
729-
parsedOptions.directConnection = true;
730-
}
731723

732724
const result = {
733725
hosts: hosts,

lib/sdam/server_selection.js

+4
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ function readPreferenceServerSelector(readPreference) {
187187
);
188188
}
189189

190+
if (topologyDescription.type === TopologyType.Unknown) {
191+
return [];
192+
}
193+
190194
if (
191195
topologyDescription.type === TopologyType.Single ||
192196
topologyDescription.type === TopologyType.Sharded

0 commit comments

Comments
 (0)