mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #60 from overleaf/jpa-mongo-unified-topology
[misc] mongodb: use the new db connector by default
This commit is contained in:
commit
d95f7062c5
2 changed files with 8 additions and 1 deletions
|
@ -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() {
|
||||||
|
|
|
@ -17,6 +17,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`
|
||||||
|
|
Loading…
Reference in a new issue