MCPcopy
hub / github.com/mongodb/node-mongodb-native / [Symbol.asyncIterator]

Method [Symbol.asyncIterator]

src/change_stream.ts:819–837  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

817 }
818
819 async *[Symbol.asyncIterator](): AsyncGenerator<TChange, void, void> {
820 if (this.closed) {
821 return;
822 }
823
824 try {
825 // Change streams run indefinitely as long as errors are resumable
826 // So the only loop breaking condition is if `next()` throws
827 while (true) {
828 yield await this.next();
829 }
830 } finally {
831 try {
832 await this.close();
833 } catch (error) {
834 squashError(error);
835 }
836 }
837 }
838
839 /** Is the cursor closed */
840 public get closed(): boolean {

Callers

nothing calls this directly

Calls 3

nextMethod · 0.95
closeMethod · 0.95
squashErrorFunction · 0.90

Tested by

no test coverage detected