A writable stream that enables you to write buffers to GridFS.
Do not instantiate this class directly. Use openUploadStream()
instead.
bucket
GridFSBucket
Handle for this stream's corresponding bucket
filename
string
The value of the 'filename' key in the files doc
options
object optional
Optional settings.
Name Type Default Descriptionid
string | number | object optional
Custom file id for the GridFS file.
chunkSizeBytes
number optional
The chunk size to use, in bytes
w
number | string optional
Deprecated The write concern. Use writeConcern instead.
wtimeout
number optional
Deprecated The write concern timeout. Use writeConcern instead.
j
boolean false optional
Deprecated Specify a journal write concern. Use writeConcern instead.
writeConcern
object | WriteConcern optional
Specify write concern settings.
disableMD5
boolean false optional
If true, disables adding an md5 field to file data
Places this write stream into an aborted state (all future writes fail)
and deletes all chunks that have already been written.
Tells the stream that no more data will be coming in. The stream will
persist the remaining data to MongoDB, write the files document, and
then emit a 'finish' event.
chunk
Buffer
Buffer to write
encoding
String
Optional encoding for the buffer
callback
GridFSBucket~errorCallback
Function to call when all files and chunks have been persisted to MongoDB
Write a buffer to the stream.
Name Type Descriptionchunk
Buffer
Buffer to write
encoding
String
Optional encoding for the buffer
callback
GridFSBucket~errorCallback
Function to call when the chunk was added to the buffer, or if the entire chunk was persisted to MongoDB if this chunk caused a flush.
An error occurred
Type:end()
was called and the write stream successfully wrote the file
metadata and all the chunks to MongoDB.
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