Returns a readable stream (GridFSBucketReadStream) for streaming file data from GridFS.
(
id: ObjectId,
options?: GridFSBucketReadStreamOptions
)
| 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 |
no outgoing calls