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(model): improve update minimizing to only minimize top-level properties in the update #14437

Merged
merged 1 commit into from Mar 15, 2024

Conversation

vkarpov15
Copy link
Collaborator

Fix #14420
Re: #13782

Summary

The issue in #14420 is that the update to save() is { $set: { sub: {} } }, which gets minimized away by #13782. With this PR, we'll only minimize top-level properties of update operators in the save() update. So in the #14420 case, we'll just minimize sub to null, but leave the rest of the update. I think this is the most consistent way to handle #14420 without undoing the changes we made in #13782.

Examples

@vkarpov15 vkarpov15 added this to the 8.2.2 milestone Mar 14, 2024
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.

Looks good to me

lib/model.js Show resolved Hide resolved
@vkarpov15 vkarpov15 merged commit 5ea6e38 into master Mar 15, 2024
34 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-14420 branch March 15, 2024 16:47
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.

Can not update sub schema to empty object
2 participants