Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor ReadStream support #458

Merged
merged 2 commits into from
Dec 22, 2011
Merged

Cursor ReadStream support #458

merged 2 commits into from
Dec 22, 2011

Conversation

aheckmann
Copy link
Contributor

var stream = collection.find().stream()

Returns a readable stream, compatible with any node streams.

events

data - emits a document as its only argument
error - emitted if an error occurs while streaming the documents. this event will fire before the close event
close - Emitted when the stream reaches the end of the cursor, or an error occurs, or the stream is manually destroyed. After this event, no more events will be emitted.

methods

stream#pause() - pauses the stream
stream#resume() - resumes a paused stream
stream#destroy() - destroys the stream. after this, no more events will be emitted

properties

stream.paused - flag stating whether this stream is paused or not. default false
stream.readable - flag stating whether this stream is readable or not. default true

implements the Nodejs ReadStream interface
christkv added a commit that referenced this pull request Dec 22, 2011
@christkv christkv merged commit e0e0503 into mongodb:master Dec 22, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants