These are chat archives for LearnBoost/mongoose

Jul 2018
Jul 21 2018 20:14
How do I handle error when MongoDB is down? Tested this endpoint, but it doesn't get hit at all if the request is sent when the database server is down. I am using mongoose
//GET api/silcgroups
exports.getAllSILCGroups = function(req, res){
    SILCGroup.find(req.query, function(err, silcgroups){
        if(err) {
            return res.json(err);
        else  return res.json(silcgroups);