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(update): handle runValidators when using $set on a doc array in discriminator schema #12571

Merged
merged 1 commit into from Oct 20, 2022

Conversation

vkarpov15
Copy link
Collaborator

Fix #12518

Summary

ArraySubdocument gracefully handles the case when parentArray is a Query, but looks like the schematype-specific subclass EmbeddedDocument does not. This PR makes it so that EmbeddedDocument relies on the __parentArray property that ArraySubdocument sets.

Examples

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

@vkarpov15 vkarpov15 merged commit 7fb5114 into master Oct 20, 2022
@hasezoey hasezoey deleted the vkarpov15/gh-12518 branch October 21, 2022 06:43
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.

Fail to update subSchema documentArray Error parentArray.getArrayParent is not a function
2 participants