Skip to content

Commit b41f880

Browse files
committed
Use new topology engine
1 parent a823fa1 commit b41f880

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

lib/dml/mongoose/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ MongooseDB.prototype.connect = function(db) {
7070
dbPass = configuration.getConfig('dbPass');
7171
dbReplicaset = configuration.getConfig('dbReplicaset');
7272
dbConnectionUri = configuration.getConfig('dbConnectionUri');
73-
options = configuration.getConfig('dbOptions') || {};
74-
options.domainsEnabled = true;
75-
options.useNewUrlParser = true;
73+
options = { ...configuration.getConfig('dbOptions'), ...{
74+
domainsEnabled: true,
75+
useNewUrlParser: true,
76+
useUnifiedTopology: true
77+
}};
7678

7779
// Construct the authentication part of the connection string.
7880
authenticationString = dbUser && dbPass ? dbUser + ':' + dbPass + '@' : '';

test/entry.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ function removeTestData(done) {
112112
var connStr = 'mongodb://' + testConfig.dbHost + ':' + testConfig.dbPort + '/' + testConfig.dbName;
113113
MongoClient.connect(connStr, {
114114
domainsEnabled: true,
115-
useNewUrlParser: true
115+
useNewUrlParser: true,
116+
useUnifiedTopology: true
116117
}, function(error, client) {
117118
if(error) return cb(error);
118119

0 commit comments

Comments
 (0)