How can I clear all items from a DynamoDb table without deleting and recreating the table? The table is created/defined using CloudFormation so I don't want to duplicate that concern in business code.
I'm using TypeScript/NodeJs.
This question says to scan every item, chunk into blocks of 25, then delete each item using BatchWrite
, however:
- It seems like I'm writing a lot of code do something that's presumably quite common.
- Scan returns items with their type, which I need to strip out, which involve a copy for every item, so again I'm writing a lot of code do something that's presumably quite common.
Is there a better way? Am I missing something?