Skip to content
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

Island rhythms/deprecate overwrite #13651

Merged
merged 4 commits into from Jul 25, 2023
Merged

Conversation

IslandRhythms
Copy link
Collaborator

closes #13578

lib/query.js Outdated
@@ -3259,6 +3268,10 @@ Query.prototype.findOneAndUpdate = function(filter, doc, options) {
delete options.fields;
}

if (options.overwrite) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if options.overwrite != null, we should also warn if overwrite: false is set.

Also, you should move this to _findOneAndUpdate(), because your current implementation won't catch findOneAndUpdate(filter, update).setOptions({ overwrite: true }).

@IslandRhythms IslandRhythms changed the base branch from master to 7.5 July 24, 2023 21:40
@vkarpov15 vkarpov15 merged commit 370c32d into 7.5 Jul 25, 2023
33 of 34 checks passed
@vkarpov15 vkarpov15 deleted the IslandRhythms/deprecate-overwrite branch July 25, 2023 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate overwrite option to findOneAndUpdate()
2 participants