Skip to content

Commit af57b57

Browse files
committed
fix: always return empty array for selection on unknown topology
Topology types of `Unknown` should always return an empty set of servers for server selection using a read preference NODE-2549
1 parent 94d25c3 commit af57b57

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/core/sdam/server_selection.js

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

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

0 commit comments

Comments
 (0)