Reputation: 6494
Is it possible to delete an item from DynamoDB using the Python Boto3 library by specifying a secondary index value? I won't know the primary key in advance, so is it possible to skip the step of querying the index to retrieve the primary key, and just add a condition to the delete request that includes the secondary index value?
Upvotes: 1
Views: 2698
Reputation: 6800
No, as of now it's not possible.
You have to specify the primary key to delete an item, although you can optionally pass ConditionExpression
to prevent it from being deleted if some condition is not met. Only this much flexibility api is providing us.
Upvotes: 2