From 8614df3a41005c3bc4f957db51d9c5351a17277e Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Thu, 16 May 2024 10:52:27 -0400 Subject: [PATCH] fix: forEach tests --- src/cursor/abstract_cursor.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cursor/abstract_cursor.ts b/src/cursor/abstract_cursor.ts index 23c3639de7a..c4bab719a1a 100644 --- a/src/cursor/abstract_cursor.ts +++ b/src/cursor/abstract_cursor.ts @@ -732,7 +732,12 @@ export abstract class AbstractCursor< try { const response = await this.getMore(batchSize); - if (response) { + // CursorResponse is disabled in this PR + // however the special `emptyGetMore` can be returned from find cursors + if (CursorResponse.is(response)) { + this[kId] = response.id; + this[kDocuments] = response; + } else if (response?.cursor) { const cursorId = getCursorId(response); this[kDocuments].pushMany(response.cursor.nextBatch); this[kId] = cursorId;