Last active
August 29, 2015 14:06
-
-
Save kidtronnix/9cf26df20cb58a3f5d02 to your computer and use it in GitHub Desktop.
MongoDB Connection
This file contains hidden or 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
// Creates db connection object | |
var db = new MongoDB(config.db.name, new Server(config.db.host, config.db.port, {auto_reconnect: true}), {w: 1}); | |
db.open(function(e, d) { | |
if (e) { | |
console.log(e); | |
} else{ | |
console.log('connected to database'); | |
} | |
}) | |
module.exports = db; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment