Cast array filters with embedded discriminators in arrays doesn't work #15053
Labels
can't reproduce
Mongoose devs have been unable to reproduce this issue. Close after 14 days of inactivity.
Stale
Prerequisites
Mongoose version
7.4.0
Node.js version
18.0
MongoDB server version
8.0
Typescript version (if applicable)
5.4.3
Description
When I made an update with arrayFilters in a schema with an embedded discriminators property the method castArrayFilters didn't know the discriminated properties. So Mongoose throws an error "Could not find path "pathDiscriminated" in schema"
Steps to Reproduce
So, You made an update with arrayFilters like the following:
And you have a schema like the following
Partial call stack:
Inside method getPath the method schema.path doesn't know the discriminated properties
And the path method doesn't check in the discriminators
Expected Behavior
The castArrayFilters, also check inside discriminators paths
The text was updated successfully, but these errors were encountered: