mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-27 10:11:04 +00:00
12 lines
351 B
CoffeeScript
12 lines
351 B
CoffeeScript
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()
|