Constructor
new MongoCursor()
Methods
limit(nToReturn)
Specify maximum number of documents to return.
Default is 30 and Maximum 10,000 in simulator
Parameters:
Name | Type | Description |
---|---|---|
nToReturn |
number |
Returns:
This MongoCursor for chaining
(async) next()
Gets next Document from cursor or null if no documents remain.
Returns:
Document
skip(nToSkip)
Ignore the fist x records found, default is 0
Parameters:
Name | Type | Description |
---|---|---|
nToSkip |
number |
Returns:
This MongoCursor for chaining
sort(order)
Specify the order you wiush to return sorted results.
Parameters:
Name | Type | Description |
---|---|---|
order |
Object |
Returns:
This MongoCursor to allow chaining
(async) toArray()
Get All documents in cursor as a single Array
Returns:
[Document]