MCPcopy
hub / github.com/mongodb/node-mongodb-native / openUploadStreamWithId

Method openUploadStreamWithId

src/gridfs/index.ts:131–141  ·  view source on GitHub ↗

* Returns a writable stream (GridFSBucketWriteStream) for writing * buffers to GridFS for a custom file id. The stream's 'id' property contains the resulting * file's id.

(
    id: ObjectId,
    filename: string,
    options?: GridFSBucketWriteStreamOptions
  )

Source from the content-addressed store, hash-verified

129 * file's id.
130 */
131 openUploadStreamWithId(
132 id: ObjectId,
133 filename: string,
134 options?: GridFSBucketWriteStreamOptions
135 ): GridFSBucketWriteStream {
136 return new GridFSBucketWriteStream(this, filename, {
137 timeoutMS: this.s.options.timeoutMS,
138 ...options,
139 id
140 });
141 }
142
143 /** Returns a readable stream (GridFSBucketReadStream) for streaming file data from GridFS. */
144 openDownloadStream(

Callers 2

testFunction · 0.95
node_csot.test.tsFile · 0.80

Calls

no outgoing calls

Tested by 1

testFunction · 0.76