Skip to content

Commit

Permalink
Amend connection code.
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-fox committed Nov 25, 2020
1 parent 14d26d5 commit f536f22
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions test/tools/mongoDBUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,14 @@ const async = require('async');
function cleanDb(host, name, callback) {
const url = 'mongodb://' + host + ':27017/' + name;

MongoClient.connect(
url,
function(err, db) {
if (db) {
db.dropDatabase();
MongoClient.connect(url, { useNewUrlParser: true }, function (err, db) {
if (db && db.db()) {
db.db().dropDatabase(function (err, result) {
db.close();
}
callback();
callback();
});
}
);
});
}

function cleanDbs(host, callback) {
Expand Down

0 comments on commit f536f22

Please sign in to comment.