node-mongodb-native
node-mongodb-native copied to clipboard
refactor: cursor to use fetchBatch function when current batch is empty
Description
What is changing?
- Move
nextinto cursor and rename to fetchBatch - Remove transform and blocking flags
- tryNext/next now call fetchBatch as appropriate to get the same behavior the flags provided
- move cleanupCursor logic to cleanup()
Is there new documentation needed for these changes?
No
What is the motivation for this change?
The next floating function owned too many details of the implementation of each cursor API, tryNext and next now do a small amount more lifting and we have a fetchBatch method that is focused on obtaining the next batch either with the init command or with a getMore.
Double check the following
- [x] Ran
npm run check:lintscript - [x] Self-review completed using the steps outlined here
- [x] PR title follows the correct format:
type(NODE-xxxx)[!]: description- Example:
feat(NODE-1234)!: rewriting everything in coffeescript
- Example:
- [x] Changes are covered by tests
- [x] New TODOs have a related JIRA ticket