overleaf/services/chat/app/js/mongodb.js
Eric Mc Sween f9aaa4d5de Merge pull request #10753 from overleaf/em-upgrade-mongo-driver
Upgrade the Mongo driver in the chat service

GitOrigin-RevId: 12808e624b75f0adc7fd474f774b855dc2eadefd
2022-12-09 09:04:17 +00:00

16 lines
348 B
JavaScript

const Settings = require('@overleaf/settings')
const { MongoClient, ObjectId } = require('mongodb')
const client = new MongoClient(Settings.mongo.url)
const db = client.db()
const collections = {
messages: db.collection('messages'),
rooms: db.collection('rooms'),
}
module.exports = {
db: collections,
mongoClient: client,
ObjectId,
}