2021-07-12 16:47:20 +00:00
|
|
|
const Settings = require('@overleaf/settings')
|
2020-08-21 16:50:01 +00:00
|
|
|
const { MongoClient, ObjectId } = require('mongodb')
|
|
|
|
|
2022-12-15 12:53:03 +00:00
|
|
|
const mongoClient = new MongoClient(Settings.mongo.url)
|
|
|
|
const mongoDb = mongoClient.db()
|
2020-08-21 16:50:01 +00:00
|
|
|
|
2022-12-15 12:53:03 +00:00
|
|
|
const db = {
|
|
|
|
docs: mongoDb.collection('docs'),
|
|
|
|
docOps: mongoDb.collection('docOps'),
|
2020-09-07 08:44:19 +00:00
|
|
|
}
|
2020-08-28 12:13:19 +00:00
|
|
|
|
2020-08-21 16:50:01 +00:00
|
|
|
module.exports = {
|
2020-08-28 12:13:19 +00:00
|
|
|
db,
|
2022-12-15 12:53:03 +00:00
|
|
|
mongoClient,
|
2020-08-21 16:50:01 +00:00
|
|
|
ObjectId,
|
|
|
|
}
|