SyncWriteSegmentBuilder¶
- 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