2023-02-09 12:24:44 +00:00
|
|
|
import Metrics from '@overleaf/metrics'
|
2023-01-13 12:42:29 +00:00
|
|
|
import Settings from '@overleaf/settings'
|
|
|
|
import { MongoClient } from 'mongodb'
|
|
|
|
|
|
|
|
export { ObjectId } from 'mongodb'
|
|
|
|
|
|
|
|
export const mongoClient = new MongoClient(Settings.mongo.url)
|
|
|
|
const mongoDb = mongoClient.db()
|
|
|
|
|
2023-02-09 12:24:44 +00:00
|
|
|
Metrics.mongodb.monitor(mongoClient)
|
|
|
|
|
2023-01-13 12:42:29 +00:00
|
|
|
export const db = {
|
|
|
|
deletedProjects: mongoDb.collection('deletedProjects'),
|
|
|
|
projects: mongoDb.collection('projects'),
|
|
|
|
projectHistoryFailures: mongoDb.collection('projectHistoryFailures'),
|
|
|
|
projectHistoryLabels: mongoDb.collection('projectHistoryLabels'),
|
|
|
|
projectHistorySyncState: mongoDb.collection('projectHistorySyncState'),
|
|
|
|
}
|