Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing DATASET to .in #170

Closed
lastlegion opened this issue Feb 23, 2018 · 4 comments
Closed

Passing DATASET to .in #170

lastlegion opened this issue Feb 23, 2018 · 4 comments

Comments

@lastlegion
Copy link

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
Copy link

@lastlegion Could you give an example?

@robertervin
Copy link

@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))

@lastlegion
Copy link
Author

Thanks! This would be perfect, but I'm having issues running .collect(). #171

@lastlegion
Copy link
Author

Thanks for your help @robertervin with issue #171. This works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants