Skip to content

Instantly share code, notes, and snippets.

@ovaillancourt
Created June 20, 2012 13:00
Show Gist options
  • Save ovaillancourt/2959782 to your computer and use it in GitHub Desktop.
Save ovaillancourt/2959782 to your computer and use it in GitHub Desktop.
var mongoose = require('mongoose');
mongoose.connect("yourServerUrlHere", function(err){
if(err){
console.log("Error connecting:",err);
}
else{
console.log('connected!');
}
});
//Url follows this pattern -> mongodb://YourLogin:YourPass@ServerIp/DatabaseName, the login and pass is not required if
//your server doesn't need authentication.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment