mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
[misc] mongodb: use the new db connector by default
mongojs was enabling it by default as well.
This commit is contained in:
@@ -1,7 +1,10 @@
|
|||||||
const Settings = require('settings-sharelatex')
|
const Settings = require('settings-sharelatex')
|
||||||
const { MongoClient, ObjectId } = require('mongodb')
|
const { MongoClient, ObjectId } = require('mongodb')
|
||||||
|
|
||||||
const clientPromise = MongoClient.connect(Settings.mongo.url)
|
const clientPromise = MongoClient.connect(
|
||||||
|
Settings.mongo.url,
|
||||||
|
Settings.mongo.options
|
||||||
|
)
|
||||||
|
|
||||||
let setupDbPromise
|
let setupDbPromise
|
||||||
async function waitForDb() {
|
async function waitForDb() {
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
mongo: {
|
mongo: {
|
||||||
|
options: {
|
||||||
|
useUnifiedTopology:
|
||||||
|
(process.env.MONGO_USE_UNIFIED_TOPOLOGY || 'true') === 'true'
|
||||||
|
},
|
||||||
url:
|
url:
|
||||||
process.env.MONGO_CONNECTION_STRING ||
|
process.env.MONGO_CONNECTION_STRING ||
|
||||||
`mongodb://${process.env.MONGO_HOST || 'localhost'}/sharelatex`
|
`mongodb://${process.env.MONGO_HOST || 'localhost'}/sharelatex`
|
||||||
|
|||||||
Reference in New Issue
Block a user