Skip to main content

Put

Creates or replaces an item. Pass all attributes as keyword arguments.

Basic Usage

orders.put(user_id="usr_123", order_id="ord_789", status="NEW", total=250)

With Condition

from dkmio import ConditionError

# Only create if not exists (idempotent put)
try:
orders.put(
user_id="usr_123", order_id="ord_789",
status="NEW",
condition={"user_id__not_exists": True}
)
except ConditionError:
print("Order already exists")