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
Exception in template helper: Error: Unrecognized operator: $or
at http://localhost:3000/packages/minimongo.js?hash=68d94baf766fd5bcc86fc44a6758779727eb60f8:1535:13
at Function._.each._.forEach (http://localhost:3000/packages/underscore.js?hash=cde485f60699ff9aced3305f70189e39c665183c:157:22)
at operatorBranchedMatcher (http://localhost:3000/packages/minimongo.js?hash=68d94baf766fd5bcc86fc44a6758779727eb60f8:1519:5)
at compileValueSelector (http://localhost:3000/packages/minimongo.js?hash=68d94baf766fd5bcc86fc44a6758779727eb60f8:1431:12)
at http://localhost:3000/packages/minimongo.js?hash=68d94baf766fd5bcc86fc44a6758779727eb60f8:1411:26
at Function._.each._.forEach (http://localhost:3000/packages/underscore.js?hash=cde485f60699ff9aced3305f70189e39c665183c:157:22)
at compileDocumentSelector (http://localhost:3000/packages/minimongo.js?hash=68d94baf766fd5bcc86fc44a6758779727eb60f8:1398:5)
at http://localhost:3000/packages/minimongo.js?hash=68d94baf766fd5bcc86fc44a6758779727eb60f8:1546:12
at Array.map (<anonymous>)
at Function._.map._.collect (http://localhost:3000/packages/underscore.js?hash=cde485f60699ff9aced3305f70189e39c665183c:167:56)
Without looking at the code I can imagine that the mongo query generated by the package looks like { myFilterField: { $or: selectedValues }, while you would expect $or: [ { myFilterField: 'val1' }, myFilterField: 'val2' }].
You're right, $and and $or don't work inside filters. As a workaround you can create multiple filters and set the filterOperator argument to reactiveTable to $and or $or. It won't handle nested ands or ors, but I think it's enough for most use cases.
In our case, we had defined custom filter using a multiple select($or), among other filters($and). That case is indeed not possible now. I solved it by joining the selected values with a |, and passing that using the $regex query.
The Mongo operators
$or
and$and
do not work when set from a custom filter.Example code:
Resulting stacktrace:
Without looking at the code I can imagine that the mongo query generated by the package looks like
{ myFilterField: { $or: selectedValues }
, while you would expect$or: [ { myFilterField: 'val1' }, myFilterField: 'val2' }]
.This might be related to #444
The text was updated successfully, but these errors were encountered: