Bengya
Bengya

Reputation: 115

How to delete dynamodb elements using aws cli but without specifying the primary key

so I want to delete elements from my dyanmodb table, however, I want to delete them based on a filter expression. So if the "city" attribute is "London", the item should be deleted.

The solutions I found are all requiring exactly specifying the key, but in this case, the primary key is just a random number, so it would be hard to get them all.

Thank you for your help in advance.

Upvotes: 0

Views: 916

Answers (1)

Rik
Rik

Reputation: 29243

The only way to delete items from a DynamoDB table is by specifying the key. If you want to delete based on an expression, you first have to scan or query the items which satisfy that expression and then delete all items returned from that scan or query by their key.

Upvotes: 2

Related Questions