|
@@ -2,10 +2,9 @@ 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)
|
|
|
-const dbPromise = clientPromise.then((client) => client.db())
|
|
|
|
|
|
|
|
|
|
async function getCollection(name) {
|
|
async function getCollection(name) {
|
|
|
- return (await dbPromise).collection(name)
|
|
|
|
|
|
|
+ return (await clientPromise).db().collection(name)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async function waitForDb() {
|
|
async function waitForDb() {
|