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

Remove overwrite option for updateOne(), findOneAndUpdate(), etc. #13989

Merged
merged 10 commits into from Oct 24, 2023

Conversation

vkarpov15
Copy link
Collaborator

Summary

Re: #13578, remove the overwrite option for 8.0. In 7.x, Model.findOneAndUpdate(filter, update, { overwrite: true }) becomes a findOneAndReplace(), which is a vestigial quirk of back when update() with no atomic operators would overwrite the document. Given that's no longer the case, we don't really need an overwrite option anymore.

Removed a few tests that relied on overwrite: true.

Examples

@vkarpov15 vkarpov15 changed the title Vkarpov15/gh 13578 Remove overwrite option for updateOne(), findOneAndUpdate(), etc. Oct 17, 2023
Copy link
Collaborator

@IslandRhythms IslandRhythms left a comment

Choose a reason for hiding this comment

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

LGTM minus the failing typescript test.

Copy link
Collaborator

@hasezoey hasezoey left a comment

Choose a reason for hiding this comment

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

LGTM, but there are some things missing:

  • remove overwrite option from typescript types (seems like option overwrite never even existed in the types)
  • add changelog entry about removal

the current typescript types ci failing is not related to this PR, it has been introduced into the 8.0 branch by 81cba56

@vkarpov15
Copy link
Collaborator Author

@hasezoey can you re-review please?

@vkarpov15 vkarpov15 merged commit f923f6c into 8.0 Oct 24, 2023
22 checks passed
@vkarpov15 vkarpov15 added this to the 8.0 milestone Oct 24, 2023
@hasezoey hasezoey deleted the vkarpov15/gh-13578 branch October 24, 2023 15:00
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.

None yet

3 participants