Sets the batch size parameter of this cursor to the given value.
Sets the batch size parameter of this cursor to the given value.
the new batch size.
batchSize(batchSize[, callback])
Clone the cursor
Clone the cursor
Close the cursor, sending a AggregationCursor command and emitting close.
Close the cursor, sending a AggregationCursor command and emitting close.
this optional callbak will be called after executing this method. The first parameter will always contain null while; The second parameter will contain a reference to this cursor.
Iterates over all the documents for this cursor.
Iterates over all the documents for this cursor. As with {cursor.toArray}, not all of the elements will be iterated if this cursor had been previouly accessed. In that case, {cursor.rewind} can be used to reset the cursor. However, unlike {cursor.toArray}, the cursor will only hold a maximum of batch size elements at any given time if batch size is specified. Otherwise, the caller is responsible for making sure that the entire result can fit the memory.
this will be called for while iterating every document of the query result. The first parameter will contain the Error object if an error occurred, or null otherwise. While the second parameter will contain the document.
Gets a detailed information about how the query is performed on this cursor and how long it took the database to process it.
Gets a detailed information about how the query is performed on this cursor and how long it took the database to process it.
this will be called after executing this method. The first parameter will always be null while the second parameter will be an object containing the details.
explain(callback)
Check if the cursor is closed or open.
Check if the cursor is closed or open.
the state of the cursor.
Returns an array of documents.
Returns an array of documents. The caller is responsible for making sure that there is enough memory to store the results. Note that the array only contain partial results when this cursor had been previouly accessed. In that case, cursor.rewind() can be used to reset the cursor.
This will be called after executing this method successfully. The first parameter will contain the Error object if an error occurred, or null otherwise. The second parameter will contain an array of BSON deserialized objects as a result of the query.
a promise of the results
Aggregation Cursor