Aerospike.Ctx (Aerospike Driver v0.3.1)

Copy Markdown View Source

Context path steps for nested CDT operations.

Each helper returns one {context_id, value} pair that can be passed as part of a ctx list to CDT helpers.

Summary

Types

List order used when a context step creates a nested list.

Map order used when a context step creates a nested map.

A single nested-CDT navigation step.

t()

Nested CDT context path.

Functions

Navigate to every child of the current collection.

Navigate to children of the current collection that match expression.

Deserializes a Base64-encoded context path.

Deserializes MessagePack context bytes.

Navigate into a list by absolute index.

Navigate into a list by index, creating a nested list when it is missing.

Navigate into a list by rank.

Navigate to the list element equal to value.

Navigate into a map by entry index.

Navigate into the map entry for key.

Navigate into a map by key, creating a nested map when it is missing.

Navigate into a map by value rank.

Navigate to the map entry whose value equals value.

Serializes a context path to Base64-encoded MessagePack bytes.

Serializes a context path to MessagePack bytes.

Types

list_order()

@type list_order() :: :unordered | :ordered

List order used when a context step creates a nested list.

:unordered creates a normal list. :ordered creates an ordered list.

map_order()

@type map_order() :: :unordered | :key_ordered | :key_value_ordered

Map order used when a context step creates a nested map.

:unordered keeps no ordering, :key_ordered orders entries by key, and :key_value_ordered orders by key and value.

step()

@type step() :: {non_neg_integer(), term()}

A single nested-CDT navigation step.

t()

@type t() :: [step()]

Nested CDT context path.

Pass this list as ctx: to CDT operation builders that support nested collection access.

Functions

all_children()

@spec all_children() :: step()

Navigate to every child of the current collection.

all_children_with_filter(expression)

@spec all_children_with_filter(Aerospike.Exp.t()) :: step()

Navigate to children of the current collection that match expression.

The expression is evaluated with Aerospike's built-in loop variables, such as Aerospike.Exp.int_loop_var(:value), bound to each candidate child.

from_base64(encoded)

@spec from_base64(String.t()) :: t()

Deserializes a Base64-encoded context path.

from_bytes(bytes)

@spec from_bytes(binary()) :: t()

Deserializes MessagePack context bytes.

list_index(index)

@spec list_index(integer()) :: step()

Navigate into a list by absolute index.

list_index_create(index, order \\ :unordered, pad \\ false)

@spec list_index_create(integer(), list_order(), boolean()) :: step()

Navigate into a list by index, creating a nested list when it is missing.

order controls the created list order. When pad is true and index is past the current end of the list, nil elements are inserted before the new list.

list_rank(rank)

@spec list_rank(integer()) :: step()

Navigate into a list by rank.

list_value(value)

@spec list_value(term()) :: step()

Navigate to the list element equal to value.

map_index(index)

@spec map_index(integer()) :: step()

Navigate into a map by entry index.

map_key(key)

@spec map_key(term()) :: step()

Navigate into the map entry for key.

map_key_create(key, order \\ :unordered)

@spec map_key_create(term(), map_order()) :: step()

Navigate into a map by key, creating a nested map when it is missing.

map_rank(rank)

@spec map_rank(integer()) :: step()

Navigate into a map by value rank.

map_value(value)

@spec map_value(term()) :: step()

Navigate to the map entry whose value equals value.

to_base64(ctx)

@spec to_base64(t()) :: String.t()

Serializes a context path to Base64-encoded MessagePack bytes.

to_bytes(ctx)

@spec to_bytes(t()) :: binary()

Serializes a context path to MessagePack bytes.