mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
ced8a923c0
Upgrade mongodb module for project-history GitOrigin-RevId: 18782896b46b2b0512a1ce50215bb98ac3d46cea
19 lines
656 B
JavaScript
19 lines
656 B
JavaScript
import Metrics from '@overleaf/metrics'
|
|
import Settings from '@overleaf/settings'
|
|
import mongodb from 'mongodb-legacy'
|
|
const { MongoClient, ObjectId } = mongodb
|
|
|
|
export { ObjectId }
|
|
|
|
export const mongoClient = new MongoClient(Settings.mongo.url)
|
|
const mongoDb = mongoClient.db()
|
|
|
|
Metrics.mongodb.monitor(mongoClient)
|
|
|
|
export const db = {
|
|
deletedProjects: mongoDb.collection('deletedProjects'),
|
|
projects: mongoDb.collection('projects'),
|
|
projectHistoryFailures: mongoDb.collection('projectHistoryFailures'),
|
|
projectHistoryLabels: mongoDb.collection('projectHistoryLabels'),
|
|
projectHistorySyncState: mongoDb.collection('projectHistorySyncState'),
|
|
}
|