RTF
RTF

Reputation: 6494

Is it possible to delete a DynamoDB item based on secondary index with Python Boto3 lib?

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

Answers (1)

sid8491
sid8491

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

Related Questions