Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: depopulate if push() or addToSet() with an ObjectId on a populated array #14883

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

vkarpov15
Copy link
Collaborator

Fix #1635

Summary

Calling push() on a populated array with an ObjectId currently casts the ObjectId to a document, which seems like dubious behavior. This PR changes that behavior. Putting this in the 8.7 milestone for caution.

Examples

@vkarpov15 vkarpov15 added this to the 8.7 milestone Sep 10, 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.

LGTM, is it already documented that pushing a raw id type to a populated array will depopulate it?

@vkarpov15
Copy link
Collaborator Author

@hasezoey I added that in edc7dde

@vkarpov15 vkarpov15 merged commit 41aebad into 8.7 Sep 11, 2024
26 checks passed
@hasezoey hasezoey deleted the vkarpov15/gh-1635-2 branch September 12, 2024 08:53
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants