Skip to content

Instantly share code, notes, and snippets.

@esedor
Created November 15, 2011 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save esedor/1368275 to your computer and use it in GitHub Desktop.
Save esedor/1368275 to your computer and use it in GitHub Desktop.
Connecting to MongoDB in Node.JS
var mongoose = require('mongoose');
var mongoUri = 'mongodb://localhost:27017/mongoquest';
mongoose.connect(mongoUri);
mongoose.connection.on("open", function() { /* adventure! */ ; });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment