Skip to content

Instantly share code, notes, and snippets.

@s9tpepper
Created July 10, 2011 00:55
Show Gist options
  • Save s9tpepper/1074108 to your computer and use it in GitHub Desktop.
Save s9tpepper/1074108 to your computer and use it in GitHub Desktop.
Using the find() method
/* To specify how many documents to return at a time as well as other find() options
use a FindOptions object. */
const findOptions:FindOptions = new FindOptions();
findOptions.numberToSkip = 0;
findOptions.numberToReturn = 10;
/* Query is handled the same as findOne(), but the handler callback signature
is different for a find() */
const query:Document = new Document("name:Hello from Flash sucka!");
mongo.db("myDatabase").collection("myCollection").find(query, findOptions).add(onCursorReady);
function onCursorReady(cursor:Cursor):void
{
/*...do stuff...*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment