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(query): cast $pull using embedded discriminator schema when discriminator key is set in filter #14676

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

vkarpov15
Copy link
Collaborator

Fix #14675

Summary

For other update operators, we correctly handle casting embedded discriminator paths when we can infer the embedded discriminator type from the filter. But looks like not for $pull. This PR fixes that.

We should really clean up the duplicated _getSchema() followed by getEmbeddedDiscriminatorPath() calls. Looks like the only reason why we need to call _getSchema() is because of $fullPath, but we need to investigate some more to figure that out.

Examples

@vkarpov15 vkarpov15 added this to the 8.4.4 milestone Jun 19, 2024
@vkarpov15 vkarpov15 merged commit 3ad5b4f into master Jun 21, 2024
46 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-14675 branch June 21, 2024 20:48
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.

Unable to use $pull on nested array within discriminated union
2 participants