View Source Ravix.RQL.Tokens.Update (ravix v0.2.2)

RQL Update tokens

Link to this section Summary

Functions

Creates a new "decrement" update operation

Creates a new "increment" update operation

Creates a new "set" update operation

Link to this section Types

@type t() :: %Ravix.RQL.Tokens.Update{fields: [map()], token: atom()}

Link to this section Functions

Link to this function

dec(update \\ %Update{}, field, value)

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

Creates a new "decrement" update operation

Returns a Ravix.RQL.Tokens.Update

examples

Examples

iex> import alias Ravix.RQL.Tokens.Update
iex> dec("field1", 10)
Link to this function

inc(update \\ %Update{}, field, value)

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

Creates a new "increment" update operation

Returns a Ravix.RQL.Tokens.Update

examples

Examples

iex> import alias Ravix.RQL.Tokens.Update
iex> inc("field1", 10)
Link to this function

set(update \\ %Update{}, field, value)

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

Creates a new "set" update operation

Returns a Ravix.RQL.Tokens.Update

examples

Examples

iex> import alias Ravix.RQL.Tokens.Update
iex> set("field1", 10) |> set("field2", "a")