,
line 45Creates a new Command Cursor instance (INTERNAL TYPE, do not instantiate directly)
,
line 97Set the batch size for the cursor.
Name Type Descriptionvalue
number
The number of documents to return per batch. See find command documentation.
,
line 236Clone the cursor
,
line 223Close the cursor, sending a KillCursor command and emitting close.
Name Type Descriptioncallback
CommandCursor~resultCallback optional
The result callback.
,
line 210Iterates over all the documents for this cursor. As with {cursor.toArray},
not all of the elements will be iterated if this cursor had been previously 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.
callback
CommandCursor~resultCallback
The result callback.
,
line 178Check if there is any document still available in the cursor
Name Type Descriptioncallback
CommandCursor~resultCallback optional
The result callback.
,
line 230Is the cursor closed
,
line 120Add a maxTimeMS stage to the aggregation pipeline
Name Type Descriptionvalue
number
The state maxTimeMS value.
,
line 170Get the next available document from the cursor, returns null if no more documents are available.
Name Type Descriptioncallback
CommandCursor~resultCallback optional
The result callback.
,
line 1102This method will cause a stream in flowing-mode to stop emitting data events. Any data that becomes available will remain in the internal buffer.
,
line 1108This method pulls all the data out of a readable stream, and writes it to the supplied destination, automatically managing the flow so that the destination is not overwhelmed by a fast readable stream.
Name Type Descriptiondestination
Writable
The destination for writing data
options
object optional
Pipe options
,
line 1082The read() method pulls some data out of the internal buffer and returns it. If there is no data available, then it will return null.
Name Type Descriptionsize
number
Optional argument to specify how much data to read.
,
line 1096This method will cause the readable stream to resume emitting data events.
,
line 242Resets the cursor
,
line 1089Call this function to cause the stream to return strings of the specified encoding instead of Buffer objects.
Name Type Descriptionencoding
string
The encoding to use.
,
line 67Set the ReadPreference for the cursor.
Name Type DescriptionreadPreference
string | ReadPreference
The new read preference for the cursor.
,
line 193Returns 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 previously accessed.
callback
CommandCursor~toArrayResultCallback optional
The result callback.
,
line 1116This method will remove the hooks set up for a previous pipe() call.
Name Type Descriptiondestination
Writable optional
The destination for writing data
,
line 1123This is useful in certain cases where a stream is being consumed by a parser, which needs to "un-consume" some data that it has optimistically pulled out of the source, so that the stream can be passed on to some other party.
Name Type Descriptionchunk
Buffer | string
Chunk of data to unshift onto the read queue.
,
line 1130Versions of Node prior to v0.10 had streams that did not implement the entire Streams API as it is today. (See "Compatibility" below for more information.)
Name Type Descriptionstream
Stream
An "old style" readable stream.
,
line 254The callback error format for the forEach iterator method
Name Type Descriptionerror
MongoError
An error instance representing the error during the execution.
,
line 248The callback format for the forEach iterator method
Name Type Descriptiondoc
Object
An emitted document for the iterator
,
line 203The callback format for results
Name Type Descriptionerror
MongoError
An error instance representing the error during the execution.
result
object | null
The result object if the command was executed successfully.
,
line 186The callback format for results
Name Type Descriptionerror
MongoError
An error instance representing the error during the execution.
documents
Array.<object>
All the documents the satisfy the cursor.
,
line 156CommandCursor stream close event
Type:,
line 142CommandCursor stream data event, fired for each document in the cursor.
Type:,
line 149CommandCursor stream end event
Type:,
line 163CommandCursor stream readable event
Type:RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4