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

Method close

src/change_stream.ts:847–858  ·  view source on GitHub ↗

* Frees the internal resources used by the change stream.

()

Source from the content-addressed store, hash-verified

845 * Frees the internal resources used by the change stream.
846 */
847 async close(): Promise<void> {
848 this.timeoutContext?.clear();
849 this.timeoutContext = undefined;
850 this.isClosed = true;
851
852 const cursor = this.cursor;
853 try {
854 await cursor.close();
855 } finally {
856 this._endStream();
857 }
858 }
859
860 /**
861 * Return a modified Readable stream including a possible transform method.

Callers 9

[Symbol.asyncDispose]Method · 0.95
hasNextMethod · 0.95
nextMethod · 0.95
tryNextMethod · 0.95
_resumeMethod · 0.95

Calls 2

_endStreamMethod · 0.95
clearMethod · 0.45

Tested by

no test coverage detected