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
Do you want to request a feature or report a bug?
Report a Bug
What is the current behavior?
Getting an error when querying. TypeError: val[key].map is not a function at _castExpression (/opt/nodejs/node_modules/mongoose/lib/helpers/query/cast$expr.js:102:27)
If the current behavior is a bug, please provide the steps to reproduce.
When updating to 6.3 I started to get the error. I believe it may be this expression in my query below. If there is a better way to write the expression to avoid the casting error, if not a bug, please let me know.
What is the expected behavior?
Hopefully not error :)
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node 14 (AWS Lambda)
Mongoose 6.3.0
MongoDB Atlas 4.4.13
The text was updated successfully, but these errors were encountered:
It seems that mongoose expects that $not is an Array. But $not is expecting an expression not an Array.
Probably it is solved by movng the $not operator from booleanComparison to comparisonOperator. Or by adding a isArray-Check after if (booleanComparison.has(key)
Do you want to request a feature or report a bug?
Report a Bug
What is the current behavior?
Getting an error when querying. TypeError: val[key].map is not a function at _castExpression (/opt/nodejs/node_modules/mongoose/lib/helpers/query/cast$expr.js:102:27)
If the current behavior is a bug, please provide the steps to reproduce.
When updating to 6.3 I started to get the error. I believe it may be this expression in my query below. If there is a better way to write the expression to avoid the casting error, if not a bug, please let me know.
What is the expected behavior?
Hopefully not error :)
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node 14 (AWS Lambda)
Mongoose 6.3.0
MongoDB Atlas 4.4.13
The text was updated successfully, but these errors were encountered: