mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 23:35:29 -05:00
5c70e5c534
Upgrade mongodb module for docstore from 4.11.0 to 6.2.0 GitOrigin-RevId: 443bdcc80398f7cd21bc78a801af3033d2b8e921
19 lines
427 B
JavaScript
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,
|
|
}
|