List CDT operations for Aerospike.operate/4.
These builders create server-side list operations. Pass ctx: for nested CDT
paths and return_type: for selector operations that can return indexes,
ranks, counts, values, or existence flags.
Summary
Types
Common list operation options.
List order attribute.
List write policy accepted in opts[:policy].
Raw compatibility value for server integer policy constants.
List selector return type.
List sort flag or flags.
Opaque list CDT operation for Aerospike.operate/4.
List write policy flag or flags.
Functions
Appends a value to a list bin.
Appends multiple values to a list bin.
Removes all values from the list.
Creates a list at the selected context level.
Returns the value at index.
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 entry 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.
Returns count values starting at index.
Returns values from index through the end of the list.
Increments the numeric value at index.
Inserts a value at index.
Inserts multiple values at index.
Create ordered lists.
Create unordered lists by default.
Removes and returns the value at index.
Removes and returns count values starting at index.
Removes and returns values from index through the end of the list.
Removes the value at index and returns the removed count.
Removes the value at index, returning data selected by return_type:.
Removes count values from index, returning selected data.
Removes values from index through the end, returning selected data.
Removes the value at rank, returning data selected by return_type:.
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 entry 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.
Removes count values starting at index and returns the removed count.
Removes values from index through the end and returns the removed count.
Return the selected item count.
Return whether matching items exist.
Return selected item indexes.
Invert the selector so it applies outside the matched range.
Return no result for a selector operation.
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.
Sets the list order.
Sets the list order and write flags for a list bin.
Returns the number of values in the list.
Sorts the list with sort_flags.
Keeps count values starting at index and removes all others.
Only add unique list values.
Use default list write behavior.
Require list insert indexes to be inside list boundaries.
Do not fail the command when a list item is rejected by write flags.
Commit valid list items even when another item is rejected by write flags.
Types
@type opts() :: [ ctx: Aerospike.Ctx.t(), return_type: return_type(), policy: policy(), persist_index: boolean(), pad: boolean() ]
Common list operation options.
Supported keys:
:ctx- nested CDT context path fromAerospike.Ctx.:return_type- selector return type such as:value,:count, or[:value, :inverted].:policy- list write policy map for write operations that document it.:persist_index- persist the index for top-level ordered lists.:pad- allow nested list creation past the current boundary.
@type order() :: :unordered | :ordered | raw_integer()
List order attribute.
@type policy() :: %{optional(:order) => order(), optional(:flags) => write_flags()} | [order: order(), flags: write_flags()]
List write policy accepted in opts[:policy].
Append, insert, and set operations expect both :order and :flags;
increment only reads :flags.
@type raw_integer() :: non_neg_integer() | {:raw, non_neg_integer()}
Raw compatibility value for server integer policy constants.
@type return_type() :: :none | :index | :reverse_index | :rank | :reverse_rank | :count | :value | :exists | :inverted | [ :inverted | :index | :reverse_index | :rank | :reverse_rank | :count | :value | :exists ] | raw_integer()
List selector return type.
@type sort_flags() :: :default | :descending | :drop_duplicates | [:descending | :drop_duplicates] | raw_integer()
List sort flag or flags.
@opaque t()
Opaque list CDT operation for Aerospike.operate/4.
@type write_flag() :: :default | :add_unique | :insert_bounded | :no_fail | :partial
List write policy flag or flags.
@type write_flags() :: write_flag() | [write_flag()] | raw_integer()
Functions
Appends a value to a list bin.
Pass policy: [order: order, flags: flags] to include list order and write
flags in the operation payload.
Appends multiple values to a list bin.
Pass policy: [order: order, flags: flags] to include list order and write
flags in the operation payload.
Removes all values from the list.
Creates a list at the selected context level.
When ctx: is omitted, this sets the top-level bin list order. For nested
lists, pass pad: true to allow create indexes beyond the current boundary.
Returns the value at index.
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 entry in values, selected by return_type:.
Returns values in [begin_value, end_value), selected by return_type:.
Pass nil for an open range boundary.
Returns values nearest to value and greater by relative rank.
Returns count values nearest to value and greater by relative rank.
Returns count values starting at index.
Returns values from index through the end of the list.
Increments the numeric value at index.
Pass policy: %{flags: flags} to include write flags in the operation
payload.
Inserts a value at index.
Inserts multiple values at index.
@spec order_ordered() :: 1
Create ordered lists.
@spec order_unordered() :: 0
Create unordered lists by default.
Removes and returns the value at index.
Removes and returns count values starting at index.
Removes and returns values from index through the end of the list.
Removes the value at index and returns the removed count.
Removes the value at index, returning data selected by return_type:.
Removes count values from index, returning selected data.
Removes values from index through the end, returning selected data.
Removes the value at rank, returning data selected by return_type:.
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 entry in values, returning selected data.
Removes values in [begin_value, end_value), returning selected data.
Pass nil for an open range boundary.
Removes values nearest to value and greater by relative rank.
@spec remove_by_value_rel_rank_range_count( String.t(), term(), integer(), integer(), opts() ) :: t()
Removes count values nearest to value and greater by relative rank.
Removes count values starting at index and returns the removed count.
Removes values from index through the end and returns the removed count.
@spec return_count() :: 5
Return the selected item count.
@spec return_exists() :: 13
Return whether matching items exist.
@spec return_index() :: 1
Return selected item indexes.
@spec return_inverted() :: 65536
Invert the selector so it applies outside the matched range.
@spec return_none() :: 0
Return no result for a selector operation.
@spec return_rank() :: 3
Return selected value ranks.
@spec return_reverse_index() :: 2
Return selected reverse indexes, counted from the list end.
@spec return_reverse_rank() :: 4
Return selected reverse ranks, counted from the highest value.
@spec return_value() :: 7
Return selected value or values.
Sets the value at index.
Pass policy: [order: order, flags: flags] to include list order and write
flags in the operation payload.
Sets the list order.
Pass persist_index: true to persist an index for a top-level ordered list.
@spec set_type(String.t(), order(), write_flags(), opts()) :: t()
Sets the list order and write flags for a list bin.
Returns the number of values in the list.
@spec sort(String.t(), sort_flags() | opts(), opts()) :: t()
Sorts the list with sort_flags.
Keeps count values starting at index and removes all others.
@spec write_add_unique() :: 1
Only add unique list values.
@spec write_default() :: 0
Use default list write behavior.
@spec write_insert_bounded() :: 2
Require list insert indexes to be inside list boundaries.
@spec write_no_fail() :: 4
Do not fail the command when a list item is rejected by write flags.
@spec write_partial() :: 8
Commit valid list items even when another item is rejected by write flags.