This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Db = require('mongodb').Db; | |
var Connection = require('mongodb').Connection; | |
var Server = require('mongodb').Server; | |
//the MongoDB connection | |
var connectionInstance; | |
module.exports = function(callback) { | |
//if already we have a connection, don't connect to database again | |
if (connectionInstance) { | |
callback(connectionInstance); |