A utility method for creating Readable Streams out of iterators.
Event emitter The defined events on documents including:
Adds a cursor flag.
Useful for setting the noCursorTimeout
and tailable
flags.
Marks this cursor as closed. Will stop streaming and subsequent calls to
next()
will error.
Rewind this cursor to its uninitialized state. Any options that are present on the cursor will remain in effect. Iterating this cursor will cause new queries to be sent to the server, even if the resultant data has already been retrieved by this cursor.
Execute fn
for every document(s) in the cursor. If batchSize is provided
fn
will be executed for each batch of documents. If fn
returns a promise,
will wait for the promise to resolve before iterating on to the next one.
Returns a promise that resolves when done.
Registers a transform function which subsequently maps documents retrieved
via the streams interface or .next()
Get the next document from this cursor. Will return null
when there are
no documents left.
This symbol shall be used to install a listener for only monitoring 'error'
events. Listeners installed using this symbol are called before the regular
'error'
listeners are called.
Installing a listener using this symbol does not change the behavior once an
'error'
event is emitted, therefore the process will still crash if no
regular 'error'
listener is installed.
Sets or gets the default captureRejection value for all emitters.
Generated using TypeDoc
since v4.0.0