2023-02-09 12:24:44 +00:00
|
|
|
const Metrics = require('@overleaf/metrics')
|
2021-07-12 16:47:16 +00:00
|
|
|
const Settings = require('@overleaf/settings')
|
2020-08-31 08:58:47 +00:00
|
|
|
const { MongoClient, ObjectId } = require('mongodb')
|
|
|
|
|
2022-12-20 14:55:25 +00:00
|
|
|
const mongoClient = new MongoClient(Settings.mongo.url)
|
|
|
|
const mongoDb = mongoClient.db()
|
2020-08-31 08:58:47 +00:00
|
|
|
|
2022-12-20 14:55:25 +00:00
|
|
|
const db = {
|
|
|
|
notifications: mongoDb.collection('notifications'),
|
2020-09-07 08:51:16 +00:00
|
|
|
}
|
2020-08-31 08:58:47 +00:00
|
|
|
|
2023-02-09 12:24:44 +00:00
|
|
|
Metrics.mongodb.monitor(mongoClient)
|
|
|
|
|
2020-08-31 08:58:47 +00:00
|
|
|
module.exports = {
|
|
|
|
db,
|
2022-12-20 14:55:25 +00:00
|
|
|
mongoClient,
|
2020-08-31 08:58:47 +00:00
|
|
|
ObjectId,
|
|
|
|
}
|