You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched existing issues to ensure the bug has not already been reported
Mongoose version
7.4.0
Node.js version
20.13.1
MongoDB server version
7.0.9
Typescript version (if applicable)
No response
Description
I'm experiencing more or less the same bug reported in #14580 (and also #14567). This was supposedly fixed in the 8.3.5 release, but the below test case fails in every version I tested from 7.3.5 through 8.4.0.
I acknowledge that the above code doesn't really look correct - age is a Number, so a query of {age: '50'} doesn't make sense and shouldn't return any results. However, I would definitely not expect find() to modify the query arguments!
When I run this against mongoose 7.3.4 (or earlier) the test code outputs the same query object twice, as expected:
vkarpov15
added
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
and removed
has repro script
There is a repro script, the Mongoose devs need to confirm that it reproduces the issue
labels
May 24, 2024
I can see it's fixed in 7.6.13, but it's still broken in 8.4.1 and all 8.x releases that I tested with. Is it possible to include this fix in newer releases too? Thank you!
Prerequisites
Mongoose version
7.4.0
Node.js version
20.13.1
MongoDB server version
7.0.9
Typescript version (if applicable)
No response
Description
I'm experiencing more or less the same bug reported in #14580 (and also #14567). This was supposedly fixed in the 8.3.5 release, but the below test case fails in every version I tested from 7.3.5 through 8.4.0.
Steps to Reproduce
Here's the test code:
Expected Behavior
I acknowledge that the above code doesn't really look correct -
age
is aNumber
, so a query of{age: '50'}
doesn't make sense and shouldn't return any results. However, I would definitely not expectfind()
to modify the query arguments!When I run this against mongoose 7.3.4 (or earlier) the test code outputs the same query object twice, as expected:
However, if I run this against mongoose 7.4.0 or later, it modifies the
query
argument in-place, and outputs:The text was updated successfully, but these errors were encountered: