Skip to content

Instantly share code, notes, and snippets.

@thegoleffect
Created December 29, 2011 23:15
Show Gist options
  • Save thegoleffect/1536647 to your computer and use it in GitHub Desktop.
Save thegoleffect/1536647 to your computer and use it in GitHub Desktop.
[Reference][Snippet][MongooseJS]: Listen and bind on "open" event aka "on connect"
// This snippet is useful for debugging connection parameters in the connect_string, for checking if your remote mongodb server is up, etc.
var mongoose = require("mongoose");
mongoose.connect(connect_string);
mongoose.connection.on("open", function(){
console.log("connection established");
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment