2021-07-12 16:47:21 +00:00
|
|
|
const Settings = require('@overleaf/settings')
|
2020-08-19 12:00:01 +00:00
|
|
|
const { MongoClient, ObjectId } = require('mongodb')
|
|
|
|
|
2022-12-08 12:17:56 +00:00
|
|
|
const client = new MongoClient(Settings.mongo.url)
|
|
|
|
const db = client.db()
|
2020-08-19 12:00:01 +00:00
|
|
|
|
2022-12-08 12:17:56 +00:00
|
|
|
const collections = {
|
|
|
|
messages: db.collection('messages'),
|
|
|
|
rooms: db.collection('rooms'),
|
2020-09-07 08:31:50 +00:00
|
|
|
}
|
2020-08-27 15:31:27 +00:00
|
|
|
|
2020-08-19 12:00:01 +00:00
|
|
|
module.exports = {
|
2022-12-08 12:17:56 +00:00
|
|
|
db: collections,
|
|
|
|
mongoClient: client,
|
2020-08-19 12:00:01 +00:00
|
|
|
ObjectId,
|
|
|
|
}
|