Skip to content

Commit d38a6b6

Browse files
committed
refactor(topology): always ensure useUnifiedTopology is present
This will be present if the `MongoClient` is created with this option, but is not guaranteed to be there for direct uses of the `Topology` type. The way the pool is currently set up, this could result in `connect` not knowing the context of the topology its creating connections for, so always make sure the variable is present.
1 parent 7dc7cb8 commit d38a6b6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/core/sdam/topology.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ let globalTopologyCounter = 0;
3333

3434
// Constants
3535
const TOPOLOGY_DEFAULTS = {
36+
useUnifiedTopology: true,
3637
localThresholdMS: 15,
3738
serverSelectionTimeoutMS: 30000,
3839
heartbeatFrequencyMS: 10000,

0 commit comments

Comments
 (0)