View Source Arke.Core.Query.BaseFilter (Arke v1.1.33)

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

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(),
  value: term()
}

Link to this section Functions

Link to this function

new(parameter, operator, value, negate)

View Source
@spec new(
  parameter :: Arke.Core.Parameter.ParameterType,
  operator :: atom(),
  value :: any(),
  negate :: boolean()
) :: 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{}