Skip to content

Commit 092ee7b

Browse files
committed
fix: forEach tests
1 parent 7c644b8 commit 092ee7b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/cursor/abstract_cursor.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,12 @@ export abstract class AbstractCursor<
732732

733733
try {
734734
const response = await this.getMore(batchSize);
735-
if (response) {
735+
// CursorResponse is disabled in this PR
736+
// however the special `emptyGetMore` can be returned from find cursors
737+
if (CursorResponse.is(response)) {
738+
this[kId] = response.id;
739+
this[kDocuments] = response;
740+
} else if (response?.cursor) {
736741
const cursorId = getCursorId(response);
737742
this[kDocuments].pushMany(response.cursor.nextBatch);
738743
this[kId] = cursorId;

0 commit comments

Comments
 (0)