Skip to content

Instantly share code, notes, and snippets.

@s9tpepper
Created July 9, 2011 23:16
Show Gist options
  • Save s9tpepper/1074041 to your computer and use it in GitHub Desktop.
Save s9tpepper/1074041 to your computer and use it in GitHub Desktop.
Navigating through databases and collections
/* Accessing a database is done using the db() method */
mongo.db("myDatabase")
/* A reference can be stored to the DB object. */
var myDatabase:DB = mongo.db("myDatabase");
/* Accessing a collection is using the collection() method,
chained to the db() method. */
mongo.db("myDatabase").collection("myCollection")
/* A reference can be stored to the Collection object */
var myCollection:Collection = mongo.db("myDatabase").collection("myCollection");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment