Skip to content

Instantly share code, notes, and snippets.

@cadwallion
Created October 5, 2011 14:40
Show Gist options
  • Save cadwallion/1264582 to your computer and use it in GitHub Desktop.
Save cadwallion/1264582 to your computer and use it in GitHub Desktop.
Connect Mongoose to Replica Set
var mongoose = require('mongoose');
mongoose.createSetConnection('mongodb://host1:12345/testdb, mongodb://host2:12345/testdb, mongodb://host3:12345/testdb', function (err) {
if (err) {
console.log("could not connect to DB: " + err);
}
})
// CONNECTED
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment