overleaf/services/docstore/app/js/mongodb.js
Christopher Hoskin 5c70e5c534 Merge pull request #15475 from overleaf/csh-issue-11625-mongo-ug-5-docstore
Upgrade mongodb module for docstore from 4.11.0 to 6.2.0

GitOrigin-RevId: 443bdcc80398f7cd21bc78a801af3033d2b8e921
2023-12-14 09:03:21 +00:00

19 lines
427 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 = {
docs: mongoDb.collection('docs'),
docOps: mongoDb.collection('docOps'),
}
Metrics.mongodb.monitor(mongoClient)
module.exports = {
db,
mongoClient,
ObjectId,
}