We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 869b187 commit 65d1ccfCopy full SHA for 65d1ccf
lib/core/sdam/topology_description.js
@@ -150,8 +150,10 @@ class TopologyDescription {
150
151
// update the actual server description
152
serverDescriptions.set(address, serverDescription);
153
-
154
- if (serverType === ServerType.Mongos && this.options._directConnection === false) {
+ const isReplicaSet = this.options.replicaSet || this.options.setName || this.options.rs_name;
+ // _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) {
157
return new TopologyDescription(
158
TopologyType.Sharded,
159
serverDescriptions,
0 commit comments