mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
23 lines
559 B
JavaScript
23 lines
559 B
JavaScript
import Metrics from '@overleaf/metrics'
|
|
import MongoUtils from '@overleaf/mongo-utils'
|
|
import Settings from '@overleaf/settings'
|
|
import mongodb from 'mongodb-legacy'
|
|
|
|
export const mongoClient = new mongodb.MongoClient(
|
|
Settings.mongo.url,
|
|
Settings.mongo.options
|
|
)
|
|
const mongoDb = mongoClient.db()
|
|
|
|
export const db = {
|
|
notifications: mongoDb.collection('notifications'),
|
|
}
|
|
|
|
export const ObjectId = mongodb.ObjectId
|
|
|
|
Metrics.mongodb.monitor(mongoClient)
|
|
|
|
export async function cleanupTestDatabase() {
|
|
await MongoUtils.cleanupTestDatabase(mongoClient)
|
|
}
|