2023-02-09 12:24:44 +00:00
|
|
|
const Metrics = require('@overleaf/metrics')
|
|
|
|
|
2023-01-13 12:42:29 +00: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 12:24:44 +00:00
|
|
|
Metrics.mongodb.monitor(client)
|
|
|
|
|
2023-01-13 12:42:29 +00:00
|
|
|
module.exports = { client, db, chunks, blobs, globalBlobs, shardedBlobs }
|