overleaf/services/notifications/app/js/mongodb.js
Christopher Hoskin e86ef1139e Merge pull request #15350 from overleaf/csh-issue-11625-mongo-ug-5-notifications
Use mongodb-legacy in notifications for callback support

GitOrigin-RevId: 90f05f747e221c1bd61564e2e28e505d0b125467
2023-10-24 08:03:15 +00:00

18 lines
405 B
JavaScript

const Metrics = require('@overleaf/metrics')
const Settings = require('@overleaf/settings')
const { MongoClient, ObjectId } = require('mongodb-legacy')
const mongoClient = new MongoClient(Settings.mongo.url)
const mongoDb = mongoClient.db()
const db = {
notifications: mongoDb.collection('notifications'),
}
Metrics.mongodb.monitor(mongoClient)
module.exports = {
db,
mongoClient,
ObjectId,
}