mongodb.js 348 B

12345678910111213141516
  1. const Settings = require('@overleaf/settings')
  2. const { MongoClient, ObjectId } = require('mongodb')
  3. const client = new MongoClient(Settings.mongo.url)
  4. const db = client.db()
  5. const collections = {
  6. messages: db.collection('messages'),
  7. rooms: db.collection('rooms'),
  8. }
  9. module.exports = {
  10. db: collections,
  11. mongoClient: client,
  12. ObjectId,
  13. }