We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6b38312 commit fd14895Copy full SHA for fd14895
src/cursor/abstract_cursor.ts
@@ -720,7 +720,9 @@ export abstract class AbstractCursor<
720
721
if (this[kId] == null) {
722
await this.cursorInit();
723
- return;
+ // If the cursor died or returned documents, return
724
+ if (this[kDocuments].length !== 0 || this.isDead) return;
725
+ // Otherwise, run a getMore
726
}
727
728
// otherwise need to call getMore
@@ -868,6 +870,11 @@ class ReadableCursorStream extends Readable {
868
870
869
871
872
private _readNext() {
873
+ if (this._cursor[kId] === Long.ZERO) {
874
+ this.push(null);
875
+ return;
876
+ }
877
+
878
// eslint-disable-next-line github/no-then
879
this._cursor.next().then(
880
result => {
0 commit comments