mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
15 lines
386 B
JavaScript
15 lines
386 B
JavaScript
const Settings = require('settings-sharelatex')
|
|
const { MongoClient, ObjectId } = require('mongodb')
|
|
|
|
const clientConnecting = MongoClient.connect(Settings.mongo.url)
|
|
const dbPromise = clientConnecting.then((client) => client.db())
|
|
|
|
async function getCollection(name) {
|
|
return (await dbPromise).collection(name)
|
|
}
|
|
|
|
module.exports = {
|
|
clientConnecting,
|
|
ObjectId,
|
|
getCollection
|
|
}
|