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

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

Summary

Types

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

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

  • 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

iex> filter = Arke.Core.Query.BaseFilter.new(parameter: "name", operator: "eq", value: "John", negate: false)
...> Arke.Core.Query.BaseFilter.new(person, :default)

Return

%Arke.Core.Query.BaseFilter{}