Sync Query Builders¶
Synchronous query and write-verb builders delegating to aio.operations.query.
- class aerospike_sdk.sync.operations.query.SyncQueryBuilder[source]¶
Bases:
_SyncWriteVerbsConfigure and run reads, queries, and write segments synchronously.
Every chain method forwards to
QueryBuilder.execute()blocks on the owning loop manager and returnsSyncRecordStream. Detailed parameter semantics (filters, policies, CDT,on_error) are documented on the async builder.See also
- __init__(async_client, namespace, set_name, loop_manager, query_builder=None)[source]¶
Attach or create an async
QueryBuilderand the sync loop.
- with_write_operations(operations)[source]¶
Attach scalar write operations for a background dataset task.
- Return type:
- filter_expression(expression)[source]¶
Set a FilterExpression for server-side filtering.
- Return type:
- where(expression)[source]¶
- Overloads:
self, expression (str) → SyncQueryBuilder
self, expression (FilterExpression) → SyncQueryBuilder
Set the query filter from an AEL string or FilterExpression.
- with_read_policy(policy)[source]¶
Set the read policy (for single key or batch key queries).
- Return type:
- on_partition_range(start_incl, end_excl)[source]¶
Target a range of partitions for the query.
- Return type:
- limit(limit)[source]¶
Set the maximum number of records to return (alias for max_records).
- Return type:
- with_hint(hint)[source]¶
Attach a query hint for secondary index selection or scheduling.
Forwards to
with_hint().- Parameters:
hint (
QueryHint) – AQueryHintinstance.- Return type:
- Returns:
This builder for method chaining.
See also
- with_index_context(index_context)[source]¶
Explicitly override the secondary index metadata used for filter generation.
Most applications do not need this method. The client automatically discovers and caches secondary index metadata in the background.
- Parameters:
index_context (
IndexContext) – Index metadata for the query’s namespace.- Return type:
- Returns:
This builder for method chaining.
- fail_on_filtered_out()[source]¶
Include filtered-out records in the stream with FILTERED_OUT code.
- Return type:
- default_where(expression)[source]¶
- Overloads:
self, expression (str) → SyncQueryBuilder
self, expression (FilterExpression) → SyncQueryBuilder
Set a default filter for all chained operations that lack their own.
- default_expire_record_after_seconds(seconds)[source]¶
Set a default TTL for all chained operations that lack their own.
- Return type:
- default_with_no_change_in_expiration()[source]¶
Set the default to preserve each record’s existing TTL (TTL = -2).
- Return type:
- default_expiry_from_server_default()[source]¶
Set the default TTL to the namespace’s server default (TTL = 0).
- Return type:
- query(arg1, *more_keys)[source]¶
Chain another query with new key(s) for batch/point stacking.
- Return type:
- execute_background_task()[source]¶
Run a background write for this dataset query (see
QueryBuilder).- Return type:
ExecuteTask
- execute_udf_background_task(package_name, function_name, args=None)[source]¶
Run a background UDF for this dataset query (see
QueryBuilder).- Return type:
ExecuteTask
- execute(on_error=None)[source]¶
Run the configured query or write chain and block until the stream is ready.
- Parameters:
on_error (
Union[ErrorStrategy,Callable[[Key,int,AerospikeError],None],None]) – Same asexecute()(ErrorStrategyor callback).- Return type:
- Returns:
See also
- class aerospike_sdk.sync.operations.query.SyncWriteSegmentBuilder[source]¶
Bases:
_SyncWriteVerbsSynchronous multi-key write segment (mirrors
WriteSegmentBuilder).Bin scalars, CDT, expressions, and policies delegate to the embedded async segment;
execute()returnsSyncRecordStream.See also
- delete_record()[source]¶
Add a record-level delete to the current operate call.
Unlike
delete()which targets a different key, this deletes the record being operated on as part of the same atomic operation.Example:
stream = ( session.upsert(key) .bin("name").get() .delete_record() .execute() )
- Return type:
- Returns:
This segment for chaining.
See also
delete(): Start a new delete segment for a key.
- touch_record()[source]¶
Add a record-level touch to the current operate call.
Resets the record’s TTL as part of an atomic multi-operation call. Combine with
expire_record_after_seconds()to set a new TTL.Example:
stream = ( session.upsert(key) .bin("score").get() .touch_record() .expire_record_after_seconds(120) .execute() )
- Return type:
- Returns:
This segment for chaining.
See also
touch(): Start a new touch segment for a key.
- select_from(bin_name, expression, *, ignore_eval_failure=False)[source]¶
Read a computed value into a bin using an AEL expression.
- Return type:
- insert_from(bin_name, expression, *, ignore_op_failure=False, ignore_eval_failure=False, delete_if_null=False)[source]¶
Write expression result only if bin does not already exist.
- Return type:
- update_from(bin_name, expression, *, ignore_op_failure=False, ignore_eval_failure=False, delete_if_null=False)[source]¶
Write expression result only if bin already exists.
- Return type:
- upsert_from(bin_name, expression, *, ignore_op_failure=False, ignore_eval_failure=False, delete_if_null=False)[source]¶
Write expression result, creating or overwriting the bin.
- Return type:
- query(arg1, *more_keys)[source]¶
Finalize current write segment and start a read segment.
- Return type:
- expire_record_after_seconds(seconds)[source]¶
Set the TTL on the current write segment.
- Return type:
- expiry_from_server_default()[source]¶
Use the namespace’s default TTL for this record (TTL = 0).
- Return type:
- ensure_generation_is(generation)[source]¶
Set expected generation for optimistic locking.
- Return type:
- fail_on_filtered_out()[source]¶
Mark filtered-out records with
FILTERED_OUTresult code.- Return type:
- execute(on_error=None)[source]¶
Flush accumulated write operations and return a synchronous result stream.
- Parameters:
on_error (
Union[ErrorStrategy,Callable[[Key,int,AerospikeError],None],None]) – Same asSyncQueryBuilder.execute().- Return type:
- Returns:
See also
- class aerospike_sdk.sync.operations.query.SyncWriteBinBuilder[source]¶
Bases:
_SyncWriteVerbsSynchronous wrapper for bin-level write operations.
Per-bin write builder that captures a bin name and delegates all operations to the parent
SyncWriteSegmentBuilder. HyperLogLog and blob bit operations usehll_*andbit_*methods, matchingWriteBinBuilder.- set_to(value)[source]¶
Set the bin to value.
- Parameters:
value (
Any) – New value to store.- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- add(value)[source]¶
Add a numeric value to the bin.
- Parameters:
value (
Any) – Numeric value to add.- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- increment_by(value)[source]¶
Alias for
add().- Parameters:
value (
Any) – Numeric value to add.- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- append(value)[source]¶
Append a string to the bin.
- Parameters:
value (
str) – String to append.- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- prepend(value)[source]¶
Prepend a string to the bin.
- Parameters:
value (
str) – String to prepend.- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- remove()[source]¶
Delete the bin from the record.
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- get()[source]¶
Read the bin value back within a write operate.
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- list_add(value, *, unique=False, bounded=False, no_fail=False)[source]¶
Add value to an ordered list (sorted insert).
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- list_append(value, *, unique=False, bounded=False, no_fail=False)[source]¶
Append value to the end of an unordered list.
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- map_clear()[source]¶
Remove all entries from the map bin.
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- map_size()[source]¶
Return the map element count (read within operate).
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- map_upsert_items(items, *, order=None, persist_index=False, no_fail=False, partial=False)[source]¶
Put multiple map entries (create or update each key).
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- map_insert_items(items, *, order=None, persist_index=False, no_fail=False, partial=False)[source]¶
Put map entries only for keys that do not yet exist.
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- map_update_items(items, *, order=None, persist_index=False, no_fail=False, partial=False)[source]¶
Update existing map entries only (no new keys).
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- map_create(order)[source]¶
Create an empty map with the given key order.
- Parameters:
order (
MapOrder) – Key sort order for the map.- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- map_set_policy(order)[source]¶
Set map sort order policy without changing entries.
- Parameters:
order (
MapOrder) – Key sort order to apply.- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- list_clear()[source]¶
Remove all elements from the list bin.
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- list_sort(flags=ListSortFlags.DEFAULT)[source]¶
Sort the list bin.
- Parameters:
flags (
ListSortFlags) – Sort behavior flags (defaultDEFAULT).- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- list_size()[source]¶
Return the list element count (read within operate).
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- list_append_items(items, *, unique=False, bounded=False, no_fail=False, partial=False)[source]¶
Append values to an unordered list.
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- list_add_items(items, *, unique=False, bounded=False, no_fail=False, partial=False)[source]¶
Insert values into an ordered list (sorted positions).
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- list_create(order, *, pad=False, persist_index=False)[source]¶
Create an empty list with the given order.
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- list_set_order(order)[source]¶
Set list sort order without changing elements.
- Parameters:
order (
ListOrderType) – Sort order to apply.- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- list_insert(index, value, *, unique=False, bounded=False, no_fail=False)[source]¶
Insert value at index in an unordered list.
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- list_insert_items(index, items, *, unique=False, bounded=False, no_fail=False, partial=False)[source]¶
Insert a sequence of values starting at index.
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- list_set(index, value)[source]¶
Replace the element at index with value.
Semantics match
aerospike_sdk.aio.operations.query.WriteBinBuilder.list_set().- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- list_increment(index, value=1)[source]¶
Add value to the numeric element at index (default increment is
1).Semantics match
aerospike_sdk.aio.operations.query.WriteBinBuilder.list_increment().- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- list_remove(index)[source]¶
Remove the element at index.
Semantics match
aerospike_sdk.aio.operations.query.WriteBinBuilder.list_remove().- Parameters:
index (
int) – List index (0-based; negative counts from the end).- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- list_remove_range(index, count=None)[source]¶
Remove count elements starting at index, or all from index onward.
Semantics match
aerospike_sdk.aio.operations.query.WriteBinBuilder.list_remove_range().- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- list_pop(index)[source]¶
Remove and return the element at index (read in the operate result).
Semantics match
aerospike_sdk.aio.operations.query.WriteBinBuilder.list_pop().- Parameters:
index (
int) – List index (0-based; negative counts from the end).- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- list_pop_range(index, count=None)[source]¶
Pop count elements from index, or from index through the end.
Semantics match
aerospike_sdk.aio.operations.query.WriteBinBuilder.list_pop_range().- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- list_trim(index, count)[source]¶
Keep only count elements starting at index; remove the rest.
Semantics match
aerospike_sdk.aio.operations.query.WriteBinBuilder.list_trim().- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- hll_init(index_bit_count, min_hash_bit_count=-1, flags=0)[source]¶
Initialize an empty HyperLogLog sketch in this bin.
Semantics match
aerospike_sdk.aio.operations.query.WriteBinBuilder.hll_init(). The synchronous API returnsSyncWriteSegmentBuilderand usesSyncWriteSegmentBuilder.execute()instead ofawait.- Example::
session.upsert(key).bin(“visitors”).hll_init(12)
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- hll_add(values, index_bit_count=-1, min_hash_bit_count=-1, flags=0)[source]¶
Add distinct values to the HyperLogLog sketch in this bin.
Semantics match
aerospike_sdk.aio.operations.query.WriteBinBuilder.hll_add().- Example::
session.upsert(key).bin(“visitors”).hll_add([“user-1”, “user-2”])
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- hll_set_union(hll_list, flags=0)[source]¶
Merge other HyperLogLog sketches into this bin.
Semantics match
aerospike_sdk.aio.operations.query.WriteBinBuilder.hll_set_union().- Example::
session.update(key).bin(“merged”).hll_set_union([other_hll_blob])
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- hll_fold(index_bit_count)[source]¶
Reduce sketch precision to a lower index bit count.
- Example::
session.update(key).bin(“hll”).hll_fold(10)
- Parameters:
index_bit_count (
int) – Same asaerospike_sdk.aio.operations.query.WriteBinBuilder.hll_fold().- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- hll_refresh_count()[source]¶
Refresh the cached cardinality estimate stored with the sketch.
- Example::
session.update(key).bin(“hll”).hll_refresh_count()
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- hll_get_count()[source]¶
Read the estimated cardinality in a multi-operation write.
- Example::
session.update(key).bin(“hll”).hll_get_count()
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- hll_describe()[source]¶
Read index and min-hash bit parameters of the stored sketch.
- Example::
session.update(key).bin(“hll”).hll_describe()
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- hll_get_union(hll_list)[source]¶
Read the union sketch without modifying the stored bin.
- Example::
session.update(key).bin(“hll”).hll_get_union([peer_blob])
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- hll_get_union_count(hll_list)[source]¶
Read the estimated cardinality of the union with other sketches.
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- hll_get_intersect_count(hll_list)[source]¶
Read the estimated intersection cardinality with other sketches.
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- hll_get_similarity(hll_list)[source]¶
Read Jaccard similarity between this sketch and other sketches.
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- bit_resize(byte_size, resize_flags=None, policy=None)[source]¶
Grow or shrink the raw bytes backing this bin.
Semantics match
aerospike_sdk.aio.operations.query.WriteBinBuilder.bit_resize().- Example::
session.upsert(key).bin(“flags”).bit_resize(4)
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- bit_insert(byte_offset, value, policy=None)[source]¶
Insert bytes at a byte offset in the blob bin.
- Example::
session.update(key).bin(“blob”).bit_insert(0, b”x01x02”)
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- bit_remove(byte_offset, byte_size, policy=None)[source]¶
Remove a byte range from the blob bin.
- Example::
session.update(key).bin(“blob”).bit_remove(0, 2)
- Parameters:
byte_offset (
int) – Same asaerospike_sdk.aio.operations.query.WriteBinBuilder.bit_remove().byte_size (
int) – Same as the async method.
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- bit_set(bit_offset, bit_size, value, policy=None)[source]¶
Overwrite a bit range with a new value.
- Example::
session.update(key).bin(“blob”).bit_set(0, 8, b”xff”)
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- bit_or(bit_offset, bit_size, value, policy=None)[source]¶
Bitwise OR a value into a bit range.
- Example::
session.update(key).bin(“blob”).bit_or(0, 8, b”x0f”)
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- bit_xor(bit_offset, bit_size, value, policy=None)[source]¶
Bitwise XOR a value into a bit range.
- Example::
session.update(key).bin(“blob”).bit_xor(0, 8, b”xff”)
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- bit_and(bit_offset, bit_size, value, policy=None)[source]¶
Bitwise AND a value into a bit range.
- Example::
session.update(key).bin(“blob”).bit_and(0, 8, b”xf0”)
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- bit_not(bit_offset, bit_size, policy=None)[source]¶
Invert every bit in a range.
- Example::
session.update(key).bin(“blob”).bit_not(0, 8)
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- bit_lshift(bit_offset, bit_size, shift, policy=None)[source]¶
Left-shift the bits in a field.
- Example::
session.update(key).bin(“blob”).bit_lshift(0, 16, 2)
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- bit_rshift(bit_offset, bit_size, shift, policy=None)[source]¶
Right-shift the bits in a field.
- Example::
session.update(key).bin(“blob”).bit_rshift(0, 16, 2)
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- bit_add(bit_offset, bit_size, value, signed, action, policy=None)[source]¶
Add to an integer bit field (see
aerospike_sdk.aio.operations.query.WriteBinBuilder.bit_add()).- Example::
session.update(key).bin(“blob”).bit_add(0, 16, 1, False, BitwiseOverflowActions.WRAP)
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- bit_subtract(bit_offset, bit_size, value, signed, action, policy=None)[source]¶
Subtract from an integer bit field (see
aerospike_sdk.aio.operations.query.WriteBinBuilder.bit_subtract()).- Example::
session.update(key).bin(“blob”).bit_subtract(0, 16, 1, False, BitwiseOverflowActions.SATURATE)
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- bit_set_int(bit_offset, bit_size, value, policy=None)[source]¶
Write an integer value into a bit field.
- Example::
session.update(key).bin(“blob”).bit_set_int(0, 16, 42)
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- bit_get(bit_offset, bit_size)[source]¶
Read a bit range as bytes in a write operate.
- Example::
session.update(key).bin(“blob”).bit_get(0, 8)
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- bit_count(bit_offset, bit_size)[source]¶
Count bits set to 1 in a range.
- Example::
session.update(key).bin(“blob”).bit_count(0, 8)
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- bit_lscan(bit_offset, bit_size, value)[source]¶
Return the leftmost bit index matching a value in a range.
- Example::
session.update(key).bin(“blob”).bit_lscan(0, 8, True)
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- bit_rscan(bit_offset, bit_size, value)[source]¶
Return the rightmost bit index matching a value in a range.
- Example::
session.update(key).bin(“blob”).bit_rscan(0, 8, False)
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- bit_get_int(bit_offset, bit_size, signed)[source]¶
Decode an integer from a bit field.
- Example::
session.update(key).bin(“blob”).bit_get_int(0, 16, False)
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilderfor chaining.
- on_map_index(index)[source]¶
Navigate to a map element by index.
- Parameters:
index (
int) – Map index to target.- Return type:
- Returns:
CdtWriteBuilderfor writing the targeted element.
- on_map_key(key, *, create_type=None)[source]¶
Navigate to a map element by key.
- Parameters:
- Return type:
- Returns:
CdtWriteBuilderfor writing the targeted element.
- on_map_rank(rank)[source]¶
Navigate to a map element by rank (0 = lowest value).
- Parameters:
rank (
int) – Rank position (0 = lowest value).- Return type:
- Returns:
CdtWriteBuilderfor writing the targeted element.
- on_map_value(value)[source]¶
Navigate to map elements matching a value.
- Parameters:
value (
Any) – Value to match.- Return type:
- Returns:
CdtWriteInvertableBuilderfor writing the targeted element(s).
- on_map_index_range(index, count=None)[source]¶
Navigate to map elements by index range.
- Parameters:
- Return type:
- Returns:
CdtWriteInvertableBuilderfor writing the targeted element(s).
- on_map_key_range(start, end)[source]¶
Navigate to map elements by key range [start, end).
- Parameters:
- Return type:
- Returns:
CdtWriteInvertableBuilderfor writing the targeted element(s).
- on_map_rank_range(rank, count=None)[source]¶
Navigate to map elements by rank range.
- Parameters:
- Return type:
- Returns:
CdtWriteInvertableBuilderfor writing the targeted element(s).
- on_map_value_range(start, end)[source]¶
Navigate to map elements by value range [start, end).
- Parameters:
- Return type:
- Returns:
CdtWriteInvertableBuilderfor writing the targeted element(s).
- on_map_key_relative_index_range(key, index, count=None)[source]¶
Navigate to map entries by index range relative to an anchor key.
- Parameters:
- Return type:
- Returns:
CdtWriteInvertableBuilderfor writing the targeted element(s).
- on_map_value_relative_rank_range(value, rank, count=None)[source]¶
Navigate to map entries by value rank range relative to an anchor value.
- Parameters:
- Return type:
- Returns:
CdtWriteInvertableBuilderfor writing the targeted element(s).
- on_map_key_list(keys)[source]¶
Navigate to map elements matching a list of keys.
- Parameters:
- Return type:
- Returns:
CdtWriteInvertableBuilderfor writing the targeted element(s).
- on_map_value_list(values)[source]¶
Navigate to map elements matching a list of values.
- Parameters:
- Return type:
- Returns:
CdtWriteInvertableBuilderfor writing the targeted element(s).
- on_list_index(index, *, order=None, pad=False)[source]¶
Navigate to a list element by index.
- Parameters:
- Return type:
- Returns:
CdtWriteBuilderfor writing the targeted element.
- on_list_rank(rank)[source]¶
Navigate to a list element by rank (0 = lowest value).
- Parameters:
rank (
int) – Rank position (0 = lowest value).- Return type:
- Returns:
CdtWriteBuilderfor writing the targeted element.
- on_list_value(value)[source]¶
Navigate to list elements matching a value.
- Parameters:
value (
Any) – Value to match.- Return type:
- Returns:
CdtWriteInvertableBuilderfor writing the targeted element(s).
- on_list_index_range(index, count=None)[source]¶
Navigate to list elements by index range.
- Parameters:
- Return type:
- Returns:
CdtWriteInvertableBuilderfor writing the targeted element(s).
- on_list_rank_range(rank, count=None)[source]¶
Navigate to list elements by rank range.
- Parameters:
- Return type:
- Returns:
CdtWriteInvertableBuilderfor writing the targeted element(s).
- on_list_value_range(start, end)[source]¶
Navigate to list elements by value range [start, end).
- Parameters:
- Return type:
- Returns:
CdtWriteInvertableBuilderfor writing the targeted element(s).
- on_list_value_relative_rank_range(value, rank, count=None)[source]¶
Navigate to list elements by value rank range relative to an anchor value.
- Parameters:
- Return type:
- Returns:
CdtWriteInvertableBuilderfor writing the targeted element(s).
- on_list_value_list(values)[source]¶
Navigate to list elements matching a list of values.
- Parameters:
- Return type:
- Returns:
CdtWriteInvertableBuilderfor writing the targeted element(s).
- select_from(expression, *, ignore_eval_failure=False)[source]¶
Read a computed value into this bin using an AEL expression.
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- insert_from(expression, *, ignore_op_failure=False, ignore_eval_failure=False, delete_if_null=False)[source]¶
Write expression result only if bin does not already exist.
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- update_from(expression, *, ignore_op_failure=False, ignore_eval_failure=False, delete_if_null=False)[source]¶
Write expression result only if bin already exists.
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- upsert_from(expression, *, ignore_op_failure=False, ignore_eval_failure=False, delete_if_null=False)[source]¶
Write expression result, creating or overwriting the bin.
- Parameters:
- Return type:
- Returns:
The parent
SyncWriteSegmentBuilder.
- bin(bin_name)[source]¶
Start the next bin operation.
- Parameters:
bin_name (
str) – Name of the next bin.- Return type:
- Returns:
SyncWriteBinBuilderfor the named bin.
- query(arg1, *more_keys)[source]¶
Shortcut: finalize write segment and start a read segment.
- Parameters:
arg1 (
Union[Key,List[Key]]) – Key or list of keys.more_keys (
Key) – Additional keys.
- Return type:
- Returns:
SyncQueryBuilderfor read operations.
- execute(on_error=None)[source]¶
Shortcut: execute all accumulated operations.
- Parameters:
on_error (
Union[ErrorStrategy,Callable[[Key,int,AerospikeError],None],None]) – Error handling strategy.- Return type:
- Returns:
SyncRecordStreamwith operation results.