-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: CRUD
This ticket was split from DRIVERS-1447, please see that ticket for a detailed description.
Use Case
As a developer
I want optimal resource usage and performance when using findOne
So that I have performant queries and do not leave open cursors on the server.
User Experience
- findOne will no longer leave cursors open on the server or send an unnecessary killCursors command.
Dependencies
- None
Risks/Unknowns
- None
Acceptance Criteria
Implementation Requirements
- Deprecate batchSize, cursorType, limit, and noCursorTimeout options from the options that can be provided to findOne.
- Automatically set limit: 1 and singleBatch: true for all findOne find commands.
- Ensure no killCursors command is sent to the server.
- For find, if a limit and batchSize are provided with the same value, the driver must override the batchSize to limit + 1
- Refactor findOne to no longer instantiate a FindCursor and to use a command operation instead.
Testing Requirements
- Sync CRUD spec tests to https://github.com/mongodb/specifications/commit/2362d1a46f6fd463561ef99edcea496a1616da58
- Confirm any performance improvements in the findOne performance tests.
Documentation Requirements
- API docs should indicate deprecated options.
- The deprecated options are not mentioned in the CRUD/findOne section of the MongoDB Nodejs manual. The API doc update will suffice.
- Note any performance improvements in the release highlight.
Follow Up Requirements
- The completion of this ticket will also cover https://jira.mongodb.org/browse/NODE-6471 which then can be closed.