2023-02-09 07:24:44 -05:00
|
|
|
const Metrics = require('@overleaf/metrics')
|
2021-07-12 12:47:16 -04:00
|
|
|
const Settings = require('@overleaf/settings')
|
2023-10-23 04:45:57 -04:00
|
|
|
const { MongoClient, ObjectId } = require('mongodb-legacy')
|
2020-08-31 04:58:47 -04:00
|
|
|
|
2024-02-22 06:03:27 -05:00
|
|
|
const mongoClient = new MongoClient(Settings.mongo.url, Settings.mongo.options)
|
2022-12-20 09:55:25 -05:00
|
|
|
const mongoDb = mongoClient.db()
|
2020-08-31 04:58:47 -04:00
|
|
|
|
2022-12-20 09:55:25 -05:00
|
|
|
const db = {
|
|
|
|
notifications: mongoDb.collection('notifications'),
|
2020-09-07 04:51:16 -04:00
|
|
|
}
|
2020-08-31 04:58:47 -04:00
|
|
|
|
2023-02-09 07:24:44 -05:00
|
|
|
Metrics.mongodb.monitor(mongoClient)
|
|
|
|
|
2020-08-31 04:58:47 -04:00
|
|
|
module.exports = {
|
|
|
|
db,
|
2022-12-20 09:55:25 -05:00
|
|
|
mongoClient,
|
2020-08-31 04:58:47 -04:00
|
|
|
ObjectId,
|
|
|
|
}
|