From e954a20e2f59a140828d67f94a70aaaa942b32d7 Mon Sep 17 00:00:00 2001 From: Ilan Biala Date: Thu, 5 Mar 2015 22:01:36 -0500 Subject: [PATCH] Disconnect method to close DB connection --- config/lib/mongoose.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/lib/mongoose.js b/config/lib/mongoose.js index 9bb0b74a0e..76cd2e9557 100644 --- a/config/lib/mongoose.js +++ b/config/lib/mongoose.js @@ -34,3 +34,8 @@ module.exports.connect = function(cb) { } }); }; + +module.exports.disconnect = function() { + mongoose.disconnect(); + console.info(chalk.yellow('Disconnected from MongoDB.')); +};