CDT Read Builders¶
- class aerospike_sdk.aio.operations.cdt_read.CdtReadBuilder[source]¶
Bases:
Generic[T]Terminal read actions and singular navigation for a CDT path.
The parent (type
T) must exposeadd_operation(op)so the builder can register the produced operation before returning it.Navigation fields (
bin_name,ctx,to_ctx) are optional; when not provided, further navigation is not available (terminal-only).Example
Read values from a map key within a query:
stream = await ( session.query(key) .bin("settings").on_map_key("theme").get_values() .execute() )
- on_map_key(key, *, create_type=None)[source]¶
Navigate into a map element by key.
- Parameters:
- Return type:
- Returns:
CdtReadBuilderfor reading the targeted element.
- Example::
.bin(“m”).on_map_key(“x”).get_values()
- on_map_index(index)[source]¶
Navigate into a map element by index.
- Parameters:
index (
int) – Map index to target.- Return type:
- Returns:
CdtReadBuilderfor reading the targeted element.
- on_map_rank(rank)[source]¶
Navigate into a map element by rank (0 = lowest value).
- Parameters:
rank (
int) – Rank position (0 = lowest value).- Return type:
- Returns:
CdtReadBuilderfor reading the targeted element.
- on_list_index(index, *, order=None, pad=False)[source]¶
Navigate into a list element by index.
- Parameters:
- Return type:
- Returns:
CdtReadBuilderfor reading the targeted element.
- Example::
.bin(“items”).on_list_index(0).get_values()
- on_list_rank(rank)[source]¶
Navigate into a list element by rank (0 = lowest value).
- Parameters:
rank (
int) – Rank position (0 = lowest value).- Return type:
- Returns:
CdtReadBuilderfor reading the targeted element.
- on_map_value(value)[source]¶
Navigate into map elements matching a value (may match multiple).
- Parameters:
value (
Any) – Value to match.- Return type:
- Returns:
CdtReadInvertableBuilderfor reading the selection; further singular navigation is supported when this builder was produced from a nested path.
- on_map_index_range(index, count=None)[source]¶
Navigate into map elements by index range.
- Return type:
- on_map_key_range(start, end)[source]¶
Navigate into map elements by key range
[start, end).- Return type:
- on_map_value_range(start, end)[source]¶
Navigate into map elements by value range
[start, end).- Return type:
- on_map_key_relative_index_range(key, index, count=None)[source]¶
Navigate into map entries by index range relative to an anchor key.
- Return type:
- on_map_value_relative_rank_range(value, rank, count=None)[source]¶
Navigate into map entries by value rank range relative to an anchor.
- Return type:
- on_map_value_list(values)[source]¶
Navigate into map elements matching a list of values.
- Return type:
- on_list_index_range(index, count=None)[source]¶
Navigate into list elements by index range.
- Return type:
- on_list_rank_range(rank, count=None)[source]¶
Navigate into list elements by rank range.
- Return type:
- on_list_value_range(start, end)[source]¶
Navigate into list elements by value range
[start, end).- Return type:
- on_list_value_relative_rank_range(value, rank, count=None)[source]¶
Navigate into list elements by value rank range relative to anchor.
- Return type:
- on_list_value_list(values)[source]¶
Navigate into list elements matching a list of values.
- Return type:
- get_values()[source]¶
Return value(s) at the current CDT selection.
- Return type:
TypeVar(T)- Returns:
The parent builder for chaining.
- Example::
.bin(“m”).on_map_key(“x”).get_values()
- get_keys()[source]¶
Return map keys at the current CDT selection.
- Return type:
TypeVar(T)- Returns:
The parent builder for chaining.
- get_keys_and_values()[source]¶
Return map key-value pairs at the current CDT selection.
- Return type:
TypeVar(T)- Returns:
The parent builder for chaining.
- count()[source]¶
Return the count of elements at the current CDT selection.
- Return type:
TypeVar(T)- Returns:
The parent builder for chaining.
- get_indexes()[source]¶
Return indexes of the selected CDT elements.
- Return type:
TypeVar(T)- Returns:
The parent builder for chaining.
- get_reverse_indexes()[source]¶
Return reverse indexes of the selected CDT elements.
- Return type:
TypeVar(T)- Returns:
The parent builder for chaining.
- get_ranks()[source]¶
Return ranks of the selected CDT elements.
- Return type:
TypeVar(T)- Returns:
The parent builder for chaining.
- get_reverse_ranks()[source]¶
Return reverse ranks of the selected CDT elements.
- Return type:
TypeVar(T)- Returns:
The parent builder for chaining.
- exists()[source]¶
Check whether the selected CDT element(s) exist.
- Return type:
TypeVar(T)- Returns:
The parent builder for chaining.
- map_size()[source]¶
Return the element count of the map at the current CDT path.
- Return type:
TypeVar(T)- Returns:
The parent builder for chaining.
- list_size()[source]¶
Return the element count of the list at the current CDT path.
- Return type:
TypeVar(T)- Returns:
The parent builder for chaining.
- class aerospike_sdk.aio.operations.cdt_read.CdtReadInvertableBuilder[source]¶
Bases:
CdtReadBuilder[T]Terminal read actions with inverted (all-others) variants.
Used for range and list selectors where INVERTED makes semantic sense (e.g. “all keys except those in this range”). When constructed with
to_ctxset (e.g. after a singular value selector on a nested path), singular navigation methods continue the CDT path.Example
Get all map values except those in a key range:
.bin("m").on_map_key_range("a", "d").get_all_other_values()
- get_all_other_values()[source]¶
Return all values except those matching the selection (INVERTED).
- Return type:
TypeVar(T)- Returns:
The parent builder for chaining.
- get_all_other_keys()[source]¶
Return all map keys except those matching the selection.
- Return type:
TypeVar(T)- Returns:
The parent builder for chaining.
- get_all_other_keys_and_values()[source]¶
Return all map key-value pairs except those matching the selection.
- Return type:
TypeVar(T)- Returns:
The parent builder for chaining.
- count_all_others()[source]¶
Return the count of elements except those matching the selection.
- Return type:
TypeVar(T)- Returns:
The parent builder for chaining.
- get_all_other_indexes()[source]¶
Return indexes of all elements except those matching the selection.
- Return type:
TypeVar(T)- Returns:
The parent builder for chaining.
- get_all_other_reverse_indexes()[source]¶
Return reverse indexes of all elements except those matching the selection.
- Return type:
TypeVar(T)- Returns:
The parent builder for chaining.