how can i set a callback for the error handling if mongoose isn't able to connect to my DB?
i know of
connection.on('open', function () { ... });
but is there something like
connection.on('error', function (err) { ... });
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…