Repository navigation
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for this documentation-only clarification of unsupported overlapping cursor calls.
No open issues 🎉
What changed in this PR
This documentation-only PR clarifies that MongoDB driver cursors do not support overlapping hasNext(), next(), or tryNext() calls on the same cursor.
Changes:
- Adds class-level guidance to wait for each call to settle, explaining potential consequences of overlapping calls.
- Repeats the restriction in each method’s TSDoc without changing runtime behavior.
| File | Description |
|---|---|
src/cursor/abstract_cursor.ts |
Documents unsupported overlapping cursor calls at the class and method levels. |
Review effort: Balanced
PavelSafronov
left a comment
There was a problem hiding this comment.
ChangeStream also has the same issue, should we update those docs as well?
Have we confirmed this? I don't see a ticket for it, but if confirming it is additive work, I think we should create a ticket for it and descope it from this. |
|
I don't know about ChangeStream methods, most likely it shares the problem, but it also has it's own resume loop (with cached resume tokens), and nobody has confirmed the behaviour there. The initial report comes from |
PavelSafronov
left a comment
There was a problem hiding this comment.
Looks good, no blockers, approving.
Description
Summary of Changes
Adds TSDoc to
AbstractCursorand tohasNext(),next()andtryNext()stating that overlapping calls on the same cursor are not supported.Double check the following
npm run check:lint)type(NODE-xxxx)[!]: descriptionfeat(NODE-1234)!: rewriting everything in coffeescript