diff --git a/install/package.json b/install/package.json index 19817fda2f..68f9ed8b3e 100644 --- a/install/package.json +++ b/install/package.json @@ -50,7 +50,7 @@ "compare-versions": "5.0.3", "compression": "1.7.4", "connect-flash": "0.1.1", - "connect-mongo": "4.6.0", + "connect-mongo": "5.0.0", "connect-multiparty": "2.2.0", "connect-pg-simple": "8.0.0", "connect-redis": "6.1.3", @@ -85,7 +85,7 @@ "material-design-lite": "1.3.0", "mime": "3.0.0", "mkdirp": "2.1.5", - "mongodb": "4.14.0", + "mongodb": "5.1.0", "morgan": "1.10.0", "mousetrap": "1.6.5", "multiparty": "4.2.3", diff --git a/src/database/mongo.js b/src/database/mongo.js index c4a6c0836c..5ecf81d285 100644 --- a/src/database/mongo.js +++ b/src/database/mongo.js @@ -173,9 +173,8 @@ async function getCollectionStats(db) { return await Promise.all(items.map(collection => db.collection(collection.name).stats())); } -mongoModule.close = function (callback) { - callback = callback || function () {}; - client.close(err => callback(err)); +mongoModule.close = async function () { + await client.close(); }; require('./mongo/main')(mongoModule);