new GridStoreStream(){GridStoreStream}
Create a new GridStoreStream instance (INTERNAL TYPE, do not instantiate directly)
- Deprecated
- Use GridFSBucket API instead
Returns:
GridStoreStream instance.Extends
Methods
-
inherited end(chunk, encoding, callback){null}
-
Call this method when no more data will be written to the stream. If supplied, the callback is attached as a listener on the finish event.
Name Type Description chunk
string | Buffer The data to write
encoding
string The encoding, if chunk is a String
callback
function Callback for when this chunk of data is flushed
-
inherited pause(){null}
-
This method will cause a stream in flowing-mode to stop emitting data events. Any data that becomes available will remain in the internal buffer.
-
inherited pipe(destination, options){null}
-
This 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 Description destination
Writable The destination for writing data
options
object optional Pipe options
-
inherited read(size){String|Buffer|null}
-
The 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 Description size
number Optional argument to specify how much data to read.
-
inherited resume(){null}
-
This method will cause the readable stream to resume emitting data events.
-
inherited setEncoding(encoding){null}
-
Call this function to cause the stream to return strings of the specified encoding instead of Buffer objects.
Name Type Description encoding
string The encoding to use.
-
inherited unpipe(destination){null}
-
This method will remove the hooks set up for a previous pipe() call.
Name Type Description destination
Writable optional The destination for writing data
-
inherited unshift(chunk){null}
-
This 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 Description chunk
Buffer | string Chunk of data to unshift onto the read queue.
-
inherited wrap(stream){null}
-
Versions 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 Description stream
Stream An "old style" readable stream.
-
inherited write(chunk, encoding, callback){boolean}
-
This method writes some data to the underlying system, and calls the supplied callback once the data has been fully handled.
Name Type Description chunk
string | Buffer The data to write
encoding
string The encoding, if chunk is a String
callback
function Callback for when this chunk of data is flushed
Events
-
GridStoreStream stream close event
Type:
- null
-
GridStoreStream stream data event, fired for each document in the cursor.
Type:
- object
-
GridStoreStream stream drain event
Type:
- null
-
GridStoreStream stream end event
Type:
- null
-
GridStoreStream stream error event
Type:
- null
-
finish
-
GridStoreStream stream finish event
Type:
- null
-
GridStoreStream stream pipe event
Type:
- null
-
readable
-
GridStoreStream stream readable event
Type:
- null
-
unpipe
-
GridStoreStream stream unpipe event
Type:
- null