shiftcode / dynamo-easy

DynamoDB client for NodeJS and browser with a fluent api to build requests. We take care of the type mapping between JS and DynamoDB, customizable trough typescript decorators.
https://shiftcode.github.io/dynamo-easy/
MIT License
204 stars 27 forks source link

How to delete all the rows from a table? #321

Closed itsdarrylnorris closed 3 years ago

itsdarrylnorris commented 4 years ago

How can I wipe an entire table with a single command? Using BatchWrite?

akleiber commented 3 years ago

you can't - the easiest and cheapest way to do this is to delete the whole table and create a new one.

akleiber commented 3 years ago

if you want to do this without table deletion you have to scan the table and delete the records that are returned

itsdarrylnorris commented 3 years ago

Thanks @akleiber , I ended up adding an expiring time to each row, and use the update command to either add/update, and a combination of both of these things fixed my problem.

Closing this ticket.