View Source Arke.Core.Query.BaseFilter (Arke v0.4.1)

Base struct of a BaseFilter:

  • parameter => %Arke.Core.Parameter.ParameterType => refer to Arke.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

Link to this section Types

@type t() :: %Arke.Core.Query.BaseFilter{
  negate: term(),
  operator: term(),
  parameter: term(),
  path: term(),
  value: term()
}

Link to this section Functions

Link to this function

new(parameter, operator, value, negate, path)

View Source
@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 to Arke.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{}