Search code examples
amazon-dynamodbamazon-dynamodb-streams

How to delete items containing specific string matching in DynamoDB table?


I want to delete specific string matching items in the table. For example, Table1 is having Foo123Bar and Foo345Bar in the name column.

I want to delete two recs in name column.


Solution

  • Here is how I solve it,

    You need to scan the table with the conditions and delete them with a batch delete or delete item.

    Scan and Query Example:

    http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/dynamodb-example-query-scan.html

    Batch Delete Example:

    http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html#batchWriteItem-property