Created
December 29, 2011 23:15
-
-
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 file contains 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
// 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