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

Method abort

src/gridfs/download.ts:203–208  ·  view source on GitHub ↗

* Marks this stream as aborted (will never push another `data` event) * and kills the underlying cursor. Will emit the 'end' event, and then * the 'close' event once the cursor is successfully killed.

()

Source from the content-addressed store, hash-verified

201 * the 'close' event once the cursor is successfully killed.
202 */
203 async abort(): Promise<void> {
204 this.push(null);
205 this.destroy();
206 const remainingTimeMS = this.s.timeoutContext?.getRemainingTimeMSOrThrow();
207 await this.s.cursor?.close({ timeoutMS: remainingTimeMS });
208 }
209}
210
211function throwIfInitialized(stream: GridFSBucketReadStream): void {

Callers

nothing calls this directly

Calls 4

pushMethod · 0.45
destroyMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected