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

fix(map): clean modified subpaths when overwriting values in map of subdocs #15114

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

vkarpov15
Copy link
Collaborator

Fix #15108

Summary

#15108 is due to Mongoose change tracking not cleaning up modified paths underneath maps of subdocs when overwriting the entire subdoc. So doc.map.delete('subdoc') will still leave any subpaths of map.subdoc modified. This PR cleans up those paths.

Examples

@vkarpov15 vkarpov15 added this to the 8.9.2 milestone Dec 17, 2024
Copy link
Collaborator

@AbdelrahmanHafez AbdelrahmanHafez left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@vkarpov15 vkarpov15 merged commit c393154 into master Dec 18, 2024
73 of 74 checks passed
@hasezoey hasezoey deleted the vkarpov15/gh-15108 branch December 18, 2024 14:19
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.

Cannot save document after unsetting a property of an object in a Map, then removing that object from the Map
2 participants