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(aggregate): avoid adding extra $match stage if user manually set discriminator key to correct value in first pipeline stage #12568

Merged
merged 1 commit into from Oct 20, 2022

Conversation

vkarpov15
Copy link
Collaborator

Fix #12478

Summary

#12478 points out that prepareDiscriminatorPipeline() unnecessarily adds a $match stage with the discriminator key if the user already explicitly set the correct discriminator key in the initial $match.

Examples

…t discriminator key to correct value in first pipeline stage

Fix #12478
Copy link
Collaborator

@AbdelrahmanHafez AbdelrahmanHafez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.
LGTM, thanks! 👍

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 03f19f5 into master Oct 20, 2022
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-12478 branch October 20, 2022 17:29
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.

Model with discriminatorKey throws error in aggregation pipeline when performing a search
3 participants