Skip to content

Commit 65d1ccf

Browse files
author
Thomas Reggi
committed
check
1 parent 869b187 commit 65d1ccf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/core/sdam/topology_description.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,10 @@ class TopologyDescription {
150150

151151
// update the actual server description
152152
serverDescriptions.set(address, serverDescription);
153-
154-
if (serverType === ServerType.Mongos && this.options._directConnection === false) {
153+
const isReplicaSet = this.options.replicaSet || this.options.setName || this.options.rs_name;
154+
// _directConnection is used to pass in the authored directConnection and not get the default
155+
const isDirectConnection = this.options._directConnection === false;
156+
if (serverType === ServerType.Mongos && !isReplicaSet && !isDirectConnection) {
155157
return new TopologyDescription(
156158
TopologyType.Sharded,
157159
serverDescriptions,

0 commit comments

Comments
 (0)