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(document): make update minimization unset property rather than setting to null #14504

Merged
merged 1 commit into from
Apr 7, 2024

Conversation

vkarpov15
Copy link
Collaborator

Fix #14445

Summary

Right now the Mongoose 8 functionality that minimizes empty documents when updating sets empty subdocuments to null, which is problematic because defaults don't kick in on null values. With this PR, we'll instead $unset empty subdocuments.

Examples

@vkarpov15 vkarpov15 added this to the 8.3.1 milestone Apr 7, 2024
@vkarpov15 vkarpov15 merged commit bb2eb40 into master Apr 7, 2024
34 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-14445 branch April 7, 2024 21:23
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.

Using default value on sub documents does not work as expected
2 participants