aito.client.requests.modify_operations.Update
- class aito.client.requests.modify_operations.Update(table: str)
Bases:
ModifyOperationUpdate operation for the Modify API.
Uses a fluent interface:
Update("products").where({"id": "1"}).set({"name": "New Name"}) # With upsert (insert if not exists) Update("products").where({"id": "1"}).set({"name": "Name"}).upsert()
- Parameters:
table (str) – The name of the table to update
Methods
set(fields)Set the fields to update.
to_query()Convert the operation to a query dictionary.
upsert([enable])Enable upsert mode (insert if not exists).
where(condition)Set the condition for which entries to update.
- set(fields: Dict) Update
Set the fields to update.
- Parameters:
fields (Dict) – The fields and values to set
- Returns:
self for chaining
- Return type:
- to_query() Dict
Convert the operation to a query dictionary.