Skip to content

Instantly share code, notes, and snippets.

@s9tpepper
Created July 9, 2011 23:34
Show Gist options
  • Save s9tpepper/1074057 to your computer and use it in GitHub Desktop.
Save s9tpepper/1074057 to your computer and use it in GitHub Desktop.
Connecting to mongodb
/* Add a handler to the connected Signal object to hook
in to when the database has established a connection */
mongo.db("myDatabase").connected.add(_onDBConnected);
/* Call connect() to try a connection with mongodb */
mongo.db("myDatabase").connect();
/* The Signal handler must accept a DB object, it is
a referece to the mongo.db("myDatabase") object. */
function onDBConnected(db:DB):void
{
/*...do stuff...*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment