Aerospike.Exp.List (Aerospike Driver v0.3.1)

Copy Markdown View Source

List CDT expression helpers.

These builders create expressions that evaluate list operations against a list expression, usually Aerospike.Exp.list_bin/1.

Summary

Types

Common list expression options.

List expression write policy accepted in opts[:policy].

List selector return type.

t()

Opaque server-side expression.

Functions

Appends value to a list expression. Supports policy:.

Appends list expression values to a list expression. Supports policy:.

Removes all values from the list expression.

Returns the value at index, selected by return_type:.

Returns count values from index, selected by return_type:.

Returns values from index through the end, selected by return_type:.

Returns the value at rank, selected by return_type:.

Returns count values from rank, selected by return_type:.

Returns values from rank through the highest rank, selected by return_type:.

Returns values equal to value, selected by return_type:.

Returns values matching any expression in values, selected by return_type:.

Returns values in [begin_value, end_value), selected by return_type:.

Returns values nearest to value and greater by relative rank.

Returns count values nearest to value and greater by relative rank.

Increments the numeric value at index. Supports policy:.

Inserts value at index. Supports policy: [flags: flags].

Inserts list expression values at index. Supports policy: [flags: flags].

Removes the value at index.

Removes count values from index, returning selected data.

Removes values from index through the end, returning selected data.

Removes the value at rank.

Removes count values from rank, returning selected data.

Removes values from rank through the highest rank, returning selected data.

Removes values equal to value, returning data selected by return_type:.

Removes values matching any expression in values, returning selected data.

Removes values in [begin_value, end_value), returning selected data.

Removes values nearest to value and greater by relative rank.

Removes count values nearest to value and greater by relative rank.

Return the selected item count.

Return whether matching values exist.

Return selected item indexes.

Invert the selector so it applies outside the matched range.

Return no result for a selector expression.

Return selected value ranks.

Return selected reverse indexes, counted from the list end.

Return selected reverse ranks, counted from the highest value.

Return selected value or values.

Sets the value at index. Supports policy: [flags: flags].

Returns the number of values in the list expression.

Sorts the list expression using sort_flags.

Types

opts()

@type opts() :: [policy: policy(), return_type: return_type()]

Common list expression options.

Supported keys:

  • :policy - list write policy for modify expressions that document it.
  • :return_type - selector return type such as :value, :count, or [:value, :inverted].

policy()

@type policy() :: Aerospike.Op.List.policy()

List expression write policy accepted in opts[:policy].

Append/increment operations expect both :order and :flags; insert and set operations encode only :flags.

return_type()

@type return_type() :: Aerospike.Op.List.return_type()

List selector return type.

t()

@type t() :: Aerospike.Exp.t()

Opaque server-side expression.

Functions

append(bin, value, opts \\ [])

@spec append(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()

Appends value to a list expression. Supports policy:.

append_items(bin, values, opts \\ [])

@spec append_items(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()

Appends list expression values to a list expression. Supports policy:.

clear(bin)

@spec clear(Aerospike.Exp.t()) :: t()

Removes all values from the list expression.

get_by_index(bin, index, value_type, opts \\ [])

@spec get_by_index(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.exp_type(),
  opts()
) :: t()

Returns the value at index, selected by return_type:.

get_by_index_range(bin, index, count, opts \\ [])

@spec get_by_index_range(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  opts()
) :: t()

Returns count values from index, selected by return_type:.

get_by_index_range_from(bin, index, opts \\ [])

@spec get_by_index_range_from(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()

Returns values from index through the end, selected by return_type:.

get_by_rank(bin, rank, value_type, opts \\ [])

@spec get_by_rank(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.exp_type(),
  opts()
) :: t()

Returns the value at rank, selected by return_type:.

get_by_rank_range(bin, rank, count, opts \\ [])

@spec get_by_rank_range(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  opts()
) :: t()

Returns count values from rank, selected by return_type:.

get_by_rank_range_from(bin, rank, opts \\ [])

@spec get_by_rank_range_from(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()

Returns values from rank through the highest rank, selected by return_type:.

get_by_value(bin, value, opts \\ [])

@spec get_by_value(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()

Returns values equal to value, selected by return_type:.

get_by_value_list(bin, values, opts \\ [])

@spec get_by_value_list(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()

Returns values matching any expression in values, selected by return_type:.

get_by_value_range(bin, begin_value, end_value, opts \\ [])

@spec get_by_value_range(
  Aerospike.Exp.t(),
  Aerospike.Exp.t() | nil,
  Aerospike.Exp.t() | nil,
  opts()
) ::
  t()

Returns values in [begin_value, end_value), selected by return_type:.

get_by_value_rel_rank_range(bin, value, rank, opts \\ [])

@spec get_by_value_rel_rank_range(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  opts()
) ::
  t()

Returns values nearest to value and greater by relative rank.

get_by_value_rel_rank_range_count(bin, value, rank, count, opts \\ [])

@spec get_by_value_rel_rank_range_count(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  opts()
) :: t()

Returns count values nearest to value and greater by relative rank.

increment(bin, index, value, opts \\ [])

@spec increment(Aerospike.Exp.t(), Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) ::
  t()

Increments the numeric value at index. Supports policy:.

insert(bin, index, value, opts \\ [])

@spec insert(Aerospike.Exp.t(), Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()

Inserts value at index. Supports policy: [flags: flags].

insert_items(bin, index, values, opts \\ [])

@spec insert_items(Aerospike.Exp.t(), Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) ::
  t()

Inserts list expression values at index. Supports policy: [flags: flags].

remove_by_index(bin, index)

@spec remove_by_index(Aerospike.Exp.t(), Aerospike.Exp.t()) :: t()

Removes the value at index.

remove_by_index_range(bin, index, count, opts \\ [])

@spec remove_by_index_range(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  opts()
) :: t()

Removes count values from index, returning selected data.

remove_by_index_range_from(bin, index, opts \\ [])

@spec remove_by_index_range_from(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()

Removes values from index through the end, returning selected data.

remove_by_rank(bin, rank)

@spec remove_by_rank(Aerospike.Exp.t(), Aerospike.Exp.t()) :: t()

Removes the value at rank.

remove_by_rank_range(bin, rank, count, opts \\ [])

@spec remove_by_rank_range(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  opts()
) :: t()

Removes count values from rank, returning selected data.

remove_by_rank_range_from(bin, rank, opts \\ [])

@spec remove_by_rank_range_from(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()

Removes values from rank through the highest rank, returning selected data.

remove_by_value(bin, value, opts \\ [])

@spec remove_by_value(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()

Removes values equal to value, returning data selected by return_type:.

remove_by_value_list(bin, values, opts \\ [])

@spec remove_by_value_list(Aerospike.Exp.t(), Aerospike.Exp.t(), opts()) :: t()

Removes values matching any expression in values, returning selected data.

remove_by_value_range(bin, begin_value, end_value, opts \\ [])

@spec remove_by_value_range(
  Aerospike.Exp.t(),
  Aerospike.Exp.t() | nil,
  Aerospike.Exp.t() | nil,
  opts()
) ::
  t()

Removes values in [begin_value, end_value), returning selected data.

remove_by_value_rel_rank_range(bin, value, rank, opts \\ [])

@spec remove_by_value_rel_rank_range(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  opts()
) ::
  t()

Removes values nearest to value and greater by relative rank.

remove_by_value_rel_rank_range_count(bin, value, rank, count, opts \\ [])

@spec remove_by_value_rel_rank_range_count(
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  Aerospike.Exp.t(),
  opts()
) :: t()

Removes count values nearest to value and greater by relative rank.

return_count()

@spec return_count() :: 5

Return the selected item count.

return_exists()

@spec return_exists() :: 13

Return whether matching values exist.

return_index()

@spec return_index() :: 1

Return selected item indexes.

return_inverted()

@spec return_inverted() :: 65536

Invert the selector so it applies outside the matched range.

return_none()

@spec return_none() :: 0

Return no result for a selector expression.

return_rank()

@spec return_rank() :: 3

Return selected value ranks.

return_reverse_index()

@spec return_reverse_index() :: 2

Return selected reverse indexes, counted from the list end.

return_reverse_rank()

@spec return_reverse_rank() :: 4

Return selected reverse ranks, counted from the highest value.

return_value()

@spec return_value() :: 7

Return selected value or values.

set(bin, index, value, opts \\ [])

Sets the value at index. Supports policy: [flags: flags].

size(bin)

@spec size(Aerospike.Exp.t()) :: t()

Returns the number of values in the list expression.

sort(bin, sort_flags_or_opts \\ :default)

Sorts the list expression using sort_flags.