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): handle non-string discriminator key values in query #13496

Merged
merged 1 commit into from Jun 12, 2023

Conversation

vkarpov15
Copy link
Collaborator

Fix #13492

Summary

Current casting logic doesn't account for non-string values for the discriminator key. With this change, Mongoose won't error out on non-string discriminator key values, and will also handle $in in the limited case where there's only 1 element.

Examples

@vkarpov15 vkarpov15 added this to the 7.2.4 milestone Jun 12, 2023
@vkarpov15 vkarpov15 merged commit 99e5f48 into master Jun 12, 2023
34 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-13492 branch June 12, 2023 15:26
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 $in to query a nested discriminator key field together with a field from a child schema
3 participants