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): apply schema-level paths before calculating projection for findOneAndUpdate() #13348

Merged
merged 1 commit into from May 2, 2023

Conversation

vkarpov15
Copy link
Collaborator

Fix #13340

Summary

Looks like this issue was introduced in #13059 . In order to correctly apply schema level projection, you need to call this._applyPaths(), and it looks like with #13059 findOneAndReplace() no longer calls this._applyPaths().

With this change, we only handle creating projection logic in optionsForExec(). Individual thunks are no longer responsible for calling applyPaths(), etc.

Examples

@vkarpov15 vkarpov15 added this to the 6.11.1 milestone May 1, 2023
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 2bbbb3c into 6.x May 2, 2023
33 of 34 checks passed
@hasezoey hasezoey deleted the vkarpov15/gh-13340 branch May 3, 2023 10:10
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