View Source Arke.Core.Query.BaseFilter (Arke v0.4.0)
Base struct of a BaseFilter:
- parameter => %Arke.Core.Parameter.
ParameterType
=> refer toArke.Core.Parameter
- operator => refer to operators
- value => any => the value that the query will search for
- negate => boolean => used to figure out whether the condition is to be denied
- path => [Arke.Core.Parameter.ParameterType] => the path of the parameter
It is used to keep the same logic structure across all the Filter
Link to this section Summary
Functions
Create a new BaseParameter
Link to this section Types
Link to this section Functions
@spec new( parameter :: Arke.Core.Parameter.ParameterType, operator :: atom(), value :: any(), negate :: boolean(), path :: [Arke.Core.Parameter.ParameterType] ) :: t()
Create a new BaseParameter
parameters
Parameters
- parameter => %Arke.Core.Parameter.
ParameterType
=> refer toArke.Core.Parameter
- operator => refer to operators
- value => any => the value that the query will search for
- negate => boolean => used to figure out whether the condition is to be denied
example
Example
iex> filter = Arke.Core.Query.BaseFilter.new(parameter: "name", operator: "eq", value: "John", negate: false)
...> Arke.Core.Query.BaseFilter.new(person, :default)
return
Return
%Arke.Core.Query.BaseFilter{}