2023-02-09 07:24:44 -05:00
|
|
|
const Metrics = require('@overleaf/metrics')
|
|
|
|
|
2023-01-13 07:42:29 -05:00
|
|
|
const config = require('config')
|
|
|
|
const { MongoClient } = require('mongodb')
|
|
|
|
|
|
|
|
const client = new MongoClient(config.mongo.uri)
|
|
|
|
const db = client.db()
|
|
|
|
|
|
|
|
const chunks = db.collection('projectHistoryChunks')
|
|
|
|
const blobs = db.collection('projectHistoryBlobs')
|
|
|
|
const globalBlobs = db.collection('projectHistoryGlobalBlobs')
|
|
|
|
const shardedBlobs = db.collection('projectHistoryShardedBlobs')
|
|
|
|
|
2023-02-09 07:24:44 -05:00
|
|
|
Metrics.mongodb.monitor(client)
|
|
|
|
|
2023-01-13 07:42:29 -05:00
|
|
|
module.exports = { client, db, chunks, blobs, globalBlobs, shardedBlobs }
|