diff --git a/services/document-updater/app/js/mongodb.js b/services/document-updater/app/js/mongodb.js index 8994f891da..86b015a308 100644 --- a/services/document-updater/app/js/mongodb.js +++ b/services/document-updater/app/js/mongodb.js @@ -1,7 +1,10 @@ const Settings = require('settings-sharelatex') const { MongoClient, ObjectId } = require('mongodb') -const clientPromise = MongoClient.connect(Settings.mongo.url) +const clientPromise = MongoClient.connect( + Settings.mongo.url, + Settings.mongo.options +) async function healthCheck() { const internalDb = (await clientPromise).db() diff --git a/services/document-updater/config/settings.defaults.js b/services/document-updater/config/settings.defaults.js index 21c3219a33..0228941382 100755 --- a/services/document-updater/config/settings.defaults.js +++ b/services/document-updater/config/settings.defaults.js @@ -174,6 +174,10 @@ module.exports = { dispatcherCount: process.env.DISPATCHER_COUNT, mongo: { + options: { + useUnifiedTopology: + (process.env.MONGO_USE_UNIFIED_TOPOLOGY || 'true') === 'true' + }, url: process.env.MONGO_CONNECTION_STRING || `mongodb://${process.env.MONGO_HOST || '127.0.0.1'}/sharelatex`