Created
July 10, 2011 00:55
-
-
Save s9tpepper/1074108 to your computer and use it in GitHub Desktop.
Using the find() method
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
/* 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