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
6.8.3
Node.js version
18.12.0
MongoDB server version
4.4
Typescript version (if applicable)
No response
Description
When querying fields in a sub-model that is an embedded discriminator, no filtering is done. I.e. If the ids property is an array of a sub-model that has a discriminator, then all fields are returned, not the one filtered on.
Given the model in the repro steps, the command Testr.find({'ids.email.address': 'test@example.com'}) returns all items in the DB, not the filtered ones.
This was working in 5.13.15. Notice that running the same query directly on the MongoDB connection produces the desired result.
vkarpov15
added
help
This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary
and removed
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
labels
Feb 4, 2023
Prerequisites
Mongoose version
6.8.3
Node.js version
18.12.0
MongoDB server version
4.4
Typescript version (if applicable)
No response
Description
When querying fields in a sub-model that is an embedded discriminator, no filtering is done. I.e. If the
ids
property is an array of a sub-model that has a discriminator, then all fields are returned, not the one filtered on.Given the model in the repro steps, the command
Testr.find({'ids.email.address': 'test@example.com'})
returns all items in the DB, not the filtered ones.This was working in 5.13.15. Notice that running the same query directly on the MongoDB connection produces the desired result.
Steps to Reproduce
The expectation is that
t
andt1
have the same value.Expected Behavior
Querying on an embedded discriminator sub-model should filter appropriately.
The text was updated successfully, but these errors were encountered: