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

feat(populate): pass virtual to match function to allow merging match options #13477

Merged
merged 2 commits into from Jun 7, 2023

Conversation

vkarpov15
Copy link
Collaborator

Fix #12443

Summary

#12443 asks for a way to merge match options when populated rather than overwriting. Instead of adding yet another new option, I added a new parameter to match() function: the virtual definition. That makes it easy to append the virtual match to any custom match you want to add.

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, maybe consider changing the documentation to reflect that it is now possible (or what changed?) to Populate Virtuals: The Match Option

also Schema.prototype.virtual does not list match as a possible option

@vkarpov15 vkarpov15 added this to the 7.3.0 milestone Jun 7, 2023
@vkarpov15 vkarpov15 merged commit e203d23 into 7.3 Jun 7, 2023
38 checks passed
@hasezoey hasezoey deleted the vkarpov15/gh-12443 branch June 7, 2023 09: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.

None yet

2 participants