Delete Items from NoSQL Table

You can delete items from a NoSQL table in Catalyst by identifying them using the primary keys of the table. For instance, you use just the partition key, or a combination of the partition key and sort key of the table, to identify an item.

Note: Catalyst enables you to delete a maximum of 25 items in bulk from a NoSQL table with a single SDK operation.

The delete operation is performed using thedelete_items() method as shown in the example below. The item with the partition key fruit matching “apple” and the sort key location matching “USA” is deleted. You can also specify additional conditions for delete. Only if the item matches the condition, it will be deleted.

    
copy
# Delete a NoSQL item from the table by identifying it with the partition key and sort key res = table.delete_items( { "keys": { "fruit": { "S": "apple" }, "location": { "S": "USA" } } }), # Specify a condition for delete (optional) "condition": { "function": { "function_name": "attribute_exists", "args": [ { "attribute_path": ["properties"] } ] } } }) print(res)

Last Updated 2025-06-20 16:21:48 +0530 +0530

ON THIS PAGE