Passing DATASET to .in
lastlegion opened this issue · comments
Ganesh Iyer commented
Is it possible to pass DATASET
type to .in()
operator?
I'm trying to filter on an attribute and then pass the output of that into another filter.
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Type Error: in expression has a bad type combination STRING IN DATASET
robertervin commented
@lastlegion Could you give an example?
robertervin commented
@lastlegion You can always collect a particular attribute from the dataset, and filter by that.
For instance:
dataset1.filter($("field1").in(dataset2.collect($("field2")))
This will return the dataset1
filtered by field1
values which are in dataset2's
field2
values
You can then filter that again via something like
dataset1.filter($("field1").in(dataset2.collect($("field2"))).filter($("field3").is(3))
Ganesh Iyer commented
Thanks! This would be perfect, but I'm having issues running .collect()
. #171
Ganesh Iyer commented
Thanks for your help @robertervin with issue #171. This works!