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

Avoid depopulating populated subdocs underneath document arrays when copying to another document #14458

Merged
merged 3 commits into from
Mar 26, 2024

Conversation

vkarpov15
Copy link
Collaborator

Summary

#14418 is a tricky issue, there's a couple of causes:

  1. This toObject() call swallows up the fact that you're setting the doc array element to a document that potentially includes populated values
  2. This check fails because $__.wasPopulated was true rather than an object with value

Examples

@vkarpov15 vkarpov15 added this to the 6.12.8 milestone Mar 21, 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

@vkarpov15 vkarpov15 merged commit 759f0d4 into 6.x Mar 26, 2024
33 of 34 checks passed
@hasezoey hasezoey deleted the vkarpov15/gh-14418 branch March 26, 2024 21:05
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.

2 participants