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

Method openDownloadStream

src/gridfs/index.ts:144–155  ·  view source on GitHub ↗

Returns a readable stream (GridFSBucketReadStream) for streaming file data from GridFS.

(
    id: ObjectId,
    options?: GridFSBucketReadStreamOptions
  )

Source from the content-addressed store, hash-verified

142
143 /** Returns a readable stream (GridFSBucketReadStream) for streaming file data from GridFS. */
144 openDownloadStream(
145 id: ObjectId,
146 options?: GridFSBucketReadStreamOptions
147 ): GridFSBucketReadStream {
148 return new GridFSBucketReadStream(
149 this.s._chunksCollection,
150 this.s._filesCollection,
151 this.s.options.readPreference,
152 { _id: id },
153 { timeoutMS: this.s.options.timeoutMS, ...options }
154 );
155 }
156
157 /**
158 * Deletes a file with the given id

Callers 6

testFunction · 0.95
operations.tsFile · 0.80
node_csot.test.tsFile · 0.80
sort.test-d.tsFile · 0.80

Calls

no outgoing calls

Tested by 1

testFunction · 0.76