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): make sanitizeFilter disable implicit $in #14985

Merged
merged 1 commit into from
Oct 28, 2024
Merged

Conversation

vkarpov15
Copy link
Collaborator

Re: #14657

Summary

By default, Mongoose adds $in when you query a non-array field with an array value. So Test.find({ name: ['foobar'] }) becomes Test.find({ name: { $in: ['foobar'] } }) by default. #14657 pointed out that this behavior seems contradictory with sanitizeFilter, which is supposed to disallow any query selectors. This PR makes sanitizeFilter disable the implicit $in behavior.

Examples

@vkarpov15 vkarpov15 added this to the 8.8 milestone Oct 28, 2024
@vkarpov15 vkarpov15 merged commit 663f21e into 8.8 Oct 28, 2024
58 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-14657 branch October 28, 2024 13:49
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.

2 participants