mongodb.js 337 B

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