mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-08 23:55:34 +00:00
21 lines
434 B
JavaScript
21 lines
434 B
JavaScript
const Settings = require('settings-sharelatex')
|
|
const { MongoClient, ObjectId } = require('mongodb')
|
|
|
|
const clientPromise = MongoClient.connect(Settings.mongo.url)
|
|
|
|
async function waitForDb() {
|
|
await clientPromise
|
|
}
|
|
|
|
const db = {}
|
|
waitForDb().then(async function () {
|
|
const internalDb = (await clientPromise).db()
|
|
|
|
db.notifications = internalDb.collection('notifications')
|
|
})
|
|
|
|
module.exports = {
|
|
db,
|
|
ObjectId,
|
|
waitForDb
|
|
}
|