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 plus path in projection with findOneAndUpdate() #13437

Merged
merged 1 commit into from May 24, 2023

Conversation

vkarpov15
Copy link
Collaborator

Fix #13413

Summary

Looks like we double applied paths in findOneAndUpdate(). Likely due to merge conflict issues with 6.x. Cleaned that up and added a test, so shouldn't happen again.

Examples

Copy link
Collaborator

@IslandRhythms IslandRhythms 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 e0a3f1c into master May 24, 2023
34 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-13413 branch May 24, 2023 20:39
@AbdelrahmanHafez
Copy link
Collaborator

AbdelrahmanHafez commented May 25, 2023

Does + represent anything special here? Or are we trying to be typo-tolerant?

Edit: I'm guessing + means "ignore this excluded field, and also select everything else", if that's the case, I think it's worth asserting that name is also present, as well as nickName.

@vkarpov15
Copy link
Collaborator Author

Yep "+" means "this field is excluded by default, don't exclude it for this operation".

AbdelrahmanHafez added a commit that referenced this pull request May 25, 2023
test(findOneAndUpdate): add extra assertions from code review for #13437
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.

Projection with '+' using findByIdAndUpdate does not return the property
3 participants