Filter on multiple values


When filtering on multiple values, use Filter.intersects().
For example, use Asset.fetch({filter: Filter.intersects(“id”, [“1”,“2”,“3”])}).



what if I want to filter based on multiple fields and for each field I want to filter on multiple values.

E.g. Asset.fetch({filter:‘Filter.intersects(“id”,[“1”,“2”,“3”]) && Filter.intersects(“name”,[“john”,“smith”,“jane”])’})

Is that possible…?


@venkatallagadda You can use the Filter.and property, which is chainable. Example:

 filter: Filter.intersects("id", ["1", "2", "3"]).and.intersects("name", ["john", "smith", "jane"])

See the documentation site: https://<environment_url>/static/jsduck/index.html#!/api/C3.util.Filter