View Source Ravix.RQL.Tokens.Condition (ravix v0.6.3)

Supported RQL Conditions

Link to this section Summary

Functions

Specifies that the value is between two values

Equal to condition

Greater than condition

Greater than or equal to condition

Specifies that the value is in a list

Lower than condition

Lower than or equal to condition

Not Equal to condition

Specifies that the value is not in a list

Link to this section Types

@type t() :: %Ravix.RQL.Tokens.Condition{
  field: String.t() | t(),
  params: list(),
  token: atom()
}

Link to this section Functions

Link to this function

between(field_name, values)

View Source
@spec between(atom() | String.t(), list()) :: t()

Specifies that the value is between two values

Returns a Ravix.RQL.Tokens.Condition

examples

Examples

iex> import Ravix.RQL.Tokens.Condition
iex> between("field", [15,25])
Link to this function

equal_to(field_name, value)

View Source
@spec equal_to(atom() | String.t(), any()) :: t()

Equal to condition

Returns a Ravix.RQL.Tokens.Condition

examples

Examples

iex> import Ravix.RQL.Tokens.Condition
iex> equal_to("field", "value")
Link to this function

greater_than(field_name, value)

View Source
@spec greater_than(atom() | String.t(), number()) :: t()

Greater than condition

Returns a Ravix.RQL.Tokens.Condition

examples

Examples

iex> import Ravix.RQL.Tokens.Condition
iex> greater_than("field", 10)
Link to this function

greater_than_or_equal_to(field_name, value)

View Source
@spec greater_than_or_equal_to(atom() | String.t(), number()) :: t()

Greater than or equal to condition

Returns a Ravix.RQL.Tokens.Condition

examples

Examples

iex> import Ravix.RQL.Tokens.Condition
iex> greater_than_or_equal_to("field", 10)
@spec in?(atom() | String.t(), list()) :: t()

Specifies that the value is in a list

Returns a Ravix.RQL.Tokens.Condition

examples

Examples

iex> import Ravix.RQL.Tokens.Condition
iex> in?("field", [1,2,3])
Link to this function

lower_than(field_name, value)

View Source
@spec lower_than(atom() | String.t(), number()) :: t()

Lower than condition

Returns a Ravix.RQL.Tokens.Condition

examples

Examples

iex> import Ravix.RQL.Tokens.Condition
iex> lower_than("field", 10)
Link to this function

lower_than_or_equal_to(field_name, value)

View Source
@spec lower_than_or_equal_to(atom() | String.t(), number()) :: t()

Lower than or equal to condition

Returns a Ravix.RQL.Tokens.Condition

examples

Examples

iex> import Ravix.RQL.Tokens.Condition
iex> lower_than_or_equal_to("field", 10)
Link to this function

not_equal_to(field_name, value)

View Source
@spec not_equal_to(atom() | String.t(), any()) :: t()

Not Equal to condition

Returns a Ravix.RQL.Tokens.Condition

examples

Examples

iex> import Ravix.RQL.Tokens.Condition
iex> not_equal_to("field", "value")
Link to this function

not_in(field_name, values)

View Source
@spec not_in(atom() | String.t(), list()) :: t()

Specifies that the value is not in a list

Returns a Ravix.RQL.Tokens.Condition

examples

Examples

iex> import Ravix.RQL.Tokens.Condition
iex> not_in("field", ["a", "b", "c"])