SyntaxFix
Write A Post
Hire A Developer
Questions
You can set the connection to a variable then disconnect it when you are done:
var db = mongoose.connect('mongodb://localhost:27017/somedb'); // Do some stuff db.disconnect();