Global strictQuery
flag should apply to arrayFilters
#11836
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
An error is thrown when using
arrayFilters
that do not match the schema, even ifstrictQuery
is set tofalse
.This is similar to #11062 which fixed it on the query-by-query basis, but not with the global flag.
If the current behavior is a bug, please provide the steps to reproduce.
Error: Could not find path "items.0.oldProp" in schema when
strictQuery
is set tofalse
What is the expected behavior?
This update works if
strict
is set to false on the individual query, but it should respect the globalstrictQuery
flag as well, and not throw an error.What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node: 14.x
Mongoose: 6.3.4
MongoDB: 4.2.6
The text was updated successfully, but these errors were encountered: