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
42 seems to be ignored in this case, probably because Object.keys(42) returns [].
Instead, we should expect an error like Error('"$and" expects value to be an array of objects');
Same applies to calling parse("foo") directly with a non object value, which should be prevented by type checking (i.e. parse expects a record) but can still happen if the value is any. Though I'm not sure if it should be handled by the lib or explicitly by the user, which should make sure to pass an object to parse.
The text was updated successfully, but these errors were encountered:
MongoDB $and, $nor and $or operators expect array of expressions (i.e. objects):
However, it seems that the ucast/mongo parser doesn't validate these entries, thus it's possible to call:
No exception thrown but the following condition returned:
42 seems to be ignored in this case, probably because
Object.keys(42)
returns[]
.Instead, we should expect an error like
Error('"$and" expects value to be an array of objects');
Same applies to calling
parse("foo")
directly with a non object value, which should be prevented by type checking (i.e. parse expects a record) but can still happen if the value isany
. Though I'm not sure if it should be handled by the lib or explicitly by the user, which should make sure to pass an object to parse.The text was updated successfully, but these errors were encountered: