[misc] mongodb: use the new db connector by default

mongojs was enabling it by default as well.
This commit is contained in:
Jakob Ackermann 2020-09-10 10:31:48 +01:00
parent 882db8484c
commit 97480c259d
2 changed files with 8 additions and 1 deletions

View file

@ -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
)
let setupDbPromise
async function waitForDb() {

View file

@ -10,6 +10,10 @@ module.exports = {
},
mongo: {
options: {
useUnifiedTopology:
(process.env.MONGO_USE_UNIFIED_TOPOLOGY || 'true') === 'true'
},
url:
process.env.MONGO_CONNECTION_STRING ||
`mongodb://${process.env.MONGO_HOST || 'localhost'}/sharelatex`