overleaf/services/chat/app/js/mongodb.js
Eric Mc Sween 0a12c47b35 Merge pull request #10815 from overleaf/em-esm-chat
Move chat service to ES modules

GitOrigin-RevId: c08ae8328b8f3b539e6cfe052834b84bb3756330
2022-12-14 09:03:03 +00:00

12 lines
318 B
JavaScript

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 = {
messages: mongoDb.collection('messages'),
rooms: mongoDb.collection('rooms'),
}