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: handle casting primitive array with $elemMatch in bulkWrite() #14687

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

vkarpov15
Copy link
Collaborator

Fix #14678

Summary

Right now, casting $elemMatch on a primitive array in bulkWrite() throws an error. That's because we have some logic for casting $elemMatch in the primitive array schematype that really belongs in the document array schematype, but in the past we've just thrown all conditional handling logic for arrays onto the primitive array schematype.

With this PR, we now have separate $conditionalHandlers for document array schematype vs primitive array schematype. And the offending logic that caused #14678 is only on the documentarray schematype.

Examples

@vkarpov15 vkarpov15 added this to the 8.4.4 milestone Jun 25, 2024
@vkarpov15 vkarpov15 merged commit 31111f2 into master Jun 25, 2024
46 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-14678 branch June 25, 2024 17:12
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.

BulkWrite updateOne with filter $elemMatch { $elemMatch: { $in: [] } } throwing TypeError
2 participants