-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
Use Case
As a developer using the Node driver,
I want the cursor API docs to say that overlapping hasNext() / next() / tryNext() calls are not supported,
So that I don't fire several unawaited calls on one cursor and get duplicate find commands, leaked server cursors or session errors.
User Experience
The AbstractCursor class comment, and the comments on hasNext(), next() and tryNext(), state that calls must not overlap.
Background in NODE-7908: cursorId is set only after the find response arrives, so every call that starts earlier sends its own find.
Dependencies
N/A
Risks/Unknowns
N/A
Acceptance Criteria
Implementation Requirements
N/A
Testing Requirements
N/A
Documentation Requirements
TSDoc on the AbstractCursor class and on hasNext(), next() and tryNext(), so the note shows up in an IDE hover on each method. The public API output is regenerated by the normal build.
Follow Up Requirements
N/A
- related to
-
NODE-7908 Unawaited cursor.hasNext() has unexpected non-deterministic behavior
-
- Closed
-