-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(NODE-6472): findOne and find no longer keep open cursors #4580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
6390cdd
feat(NODE-6472): run findOne without cursor
durran bc490fe
test: fix crud and explain tests
durran a0c7a84
fix: raw bson option
durran b23264d
fix: handle oid filter case
durran 1592f52
fix: lint
durran c2b6e4e
chore: debug retryability
durran 92991f4
chore: try with existing cursor logic
durran 7c20c85
fix: lint
durran c7f5f98
chore: remove dead code
durran 395d2b1
Update src/collection.ts
durran 3e28e07
Update src/collection.ts
durran 842484c
chore: address comments
durran 171f776
chore: comments
durran 9474e8f
chore: comments
durran 32925bc
chore: bring back negative limit check
durran File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
{ | ||
"description": "findOne", | ||
"schemaVersion": "1.0", | ||
"createEntities": [ | ||
{ | ||
"client": { | ||
"id": "client0", | ||
"observeEvents": [ | ||
"commandStartedEvent" | ||
] | ||
} | ||
}, | ||
{ | ||
"database": { | ||
"id": "database0", | ||
"client": "client0", | ||
"databaseName": "find-tests" | ||
} | ||
}, | ||
{ | ||
"collection": { | ||
"id": "collection0", | ||
"database": "database0", | ||
"collectionName": "coll0" | ||
} | ||
} | ||
], | ||
"initialData": [ | ||
{ | ||
"collectionName": "coll0", | ||
"databaseName": "find-tests", | ||
"documents": [ | ||
{ | ||
"_id": 1, | ||
"x": 11 | ||
}, | ||
{ | ||
"_id": 2, | ||
"x": 22 | ||
}, | ||
{ | ||
"_id": 3, | ||
"x": 33 | ||
}, | ||
{ | ||
"_id": 4, | ||
"x": 44 | ||
}, | ||
{ | ||
"_id": 5, | ||
"x": 55 | ||
}, | ||
{ | ||
"_id": 6, | ||
"x": 66 | ||
} | ||
] | ||
} | ||
], | ||
"tests": [ | ||
{ | ||
"description": "FindOne with filter", | ||
"operations": [ | ||
{ | ||
"object": "collection0", | ||
"name": "findOne", | ||
"arguments": { | ||
"filter": { | ||
"_id": 1 | ||
} | ||
}, | ||
"expectResult": { | ||
"_id": 1, | ||
"x": 11 | ||
} | ||
} | ||
], | ||
"expectEvents": [ | ||
{ | ||
"client": "client0", | ||
"events": [ | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"find": "coll0", | ||
"filter": { | ||
"_id": 1 | ||
}, | ||
"batchSize": { | ||
"$$exists": false | ||
}, | ||
"limit": 1, | ||
"singleBatch": true | ||
}, | ||
"commandName": "find", | ||
"databaseName": "find-tests" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"description": "FindOne with filter, sort, and skip", | ||
"operations": [ | ||
{ | ||
"object": "collection0", | ||
"name": "findOne", | ||
"arguments": { | ||
"filter": { | ||
"_id": { | ||
"$gt": 2 | ||
} | ||
}, | ||
"sort": { | ||
"_id": 1 | ||
}, | ||
"skip": 2 | ||
}, | ||
"expectResult": { | ||
"_id": 5, | ||
"x": 55 | ||
} | ||
} | ||
], | ||
"expectEvents": [ | ||
{ | ||
"client": "client0", | ||
"events": [ | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"find": "coll0", | ||
"filter": { | ||
"_id": { | ||
"$gt": 2 | ||
} | ||
}, | ||
"sort": { | ||
"_id": 1 | ||
}, | ||
"skip": 2, | ||
"batchSize": { | ||
"$$exists": false | ||
}, | ||
"limit": 1, | ||
"singleBatch": true | ||
}, | ||
"commandName": "find", | ||
"databaseName": "find-tests" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.