1
0
Fork 0
mirror of https://github.com/overleaf/overleaf.git synced 2025-03-06 15:33:28 +00:00
overleaf/services/document-updater/app/coffee/mongojs.coffee

13 lines
351 B
CoffeeScript
Raw Normal View History

Settings = require "settings-sharelatex"
mongojs = require "mongojs"
db = mongojs(Settings.mongo.url, ["docSnapshots"])
module.exports =
db: db
ObjectId: mongojs.ObjectId
healthCheck: (callback) ->
db.runCommand {ping: 1}, (err, res) ->
return callback(err) if err?
return callback(new Error("failed mongo ping")) if !res.ok
callback()