-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(NODE-3568)!: ensure includeResultsMetadata is false by default #3786
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
Conversation
durran
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test/types/community/collection/findX.test-d.ts has some type tests to uncomment as part of this ticket. Also I expect those existing tests in that file to be failing, but they are not as the type definitions for findOneAndUpdate, findOneAndDelete, and findOneAndReplace are still typed as returning a ModifyResult when no options are passed or an options object without includeResultMetadata is provided - so those are incorrect with the new default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just a few minor suggestions. (I think the schema helpers type tests should just use the default). There may some linting fixes needed with my change suggestions.
|
@W-A-James Can you fix the conflicts then I'll merge. Thanks! |
Co-authored-by: Durran Jordan <[email protected]>
Co-authored-by: Durran Jordan <[email protected]>
Description
What is changing?
includeResultsMetadatais now set to false by default forfindAndXfamily of methodsfindAndXmethods to setincludeResultMetadataas appropriateIs there new documentation needed for these changes?
What is the motivation for this change?
Release Highlight
findAndXfamily of methods will now setincludeResultsMetadatato false by defaultPreviously, the default return type of this family of methods was a
ModifyResultcontaining the found document and additional metadata. Now by default, they will return the found document ornull.Double check the following
npm run check:lintscripttype(NODE-xxxx)[!]: descriptionfeat(NODE-1234)!: rewriting everything in coffeescript