ash v1.13.1 Ash.Filter View Source
The representation of a filter in Ash.
Ash filters are stored as nested Ash.Filter.Expression{}
and %Ash.Filter.Not{}
structs,
terminating in a %Ash.Filter.Predicate{}
struct. An expression is simply a boolean operator
and the left and right hand side of that operator.
Filter Templates
Filter templates are simplified fielter statements (they only support atom keys), that have substitutions in them.
Currently, the substitutions are {:_actor, :field}
and {:_actor, :_primary_key}
You can pass a filter template to build_filter_from_template/2
with an actor, and it will return the new result
Additionally, you can ask if the filter template contains an actor reference via template_references_actor?/1
Link to this section Summary
Functions
Replace any actor value references in a template with the values from a given actor
Returns true if the second argument is a strict subset (always returns the same or less data) of the first
Whether or not a given template contains an actor reference
transform an expression based filter to a simple filter, which is just a list of predicates
Link to this section Types
Specs
Link to this section Functions
Replace any actor value references in a template with the values from a given actor
filter_expression_by_relationship_path(filter, path, scope? \\ false)
View SourceReturns true if the second argument is a strict subset (always returns the same or less data) of the first
Whether or not a given template contains an actor reference
transform an expression based filter to a simple filter, which is just a list of predicates