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.0.3
Node.js version
18.12
MongoDB server version
6.0
Typescript version (if applicable)
No response
Description
If a pre-query middelware (e.g. 'find') tries to modify the query projection, it has effect ONLY if the query is not a cursor. Otherwise the select/projection modified the projection of the original Query object and not the projection of the QueryCursor object.
Prerequisites
Mongoose version
7.0.3
Node.js version
18.12
MongoDB server version
6.0
Typescript version (if applicable)
No response
Description
If a pre-query middelware (e.g. 'find') tries to modify the query projection, it has effect ONLY if the query is not a cursor. Otherwise the select/projection modified the projection of the original Query object and not the projection of the QueryCursor object.
Steps to Reproduce
Here's the script:
https://gist.github.com/dbellavista/c22bfe3fbffac4be1de4cd3d9483d442
Expected Behavior
The script should not fail with an assertion error.
The text was updated successfully, but these errors were encountered: