overleaf/services/contacts/app/js/mongodb.js

15 lines
358 B
JavaScript
Raw Normal View History

import Metrics from '@overleaf/metrics'
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()
export const db = {
contacts: mongoDb.collection('contacts'),
}
Metrics.mongodb.monitor(mongoClient)