Created
July 9, 2011 23:34
-
-
Save s9tpepper/1074057 to your computer and use it in GitHub Desktop.
Connecting to mongodb
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
/* 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