DynamoDB: Delete Multiple Items in Javascript (Guide w/ Code Examples)

Provided by Rafal Wilinski
To delete multiple items from a DynamoDB table using the JavaScript SDK, you can use the batchWritemethod. This method allows you to delete multiple items in a single call, which can be more efficient than making multiple individual delete calls.
const AWS = require('aws-sdk'); const dynamoDb = new AWS.DynamoDB.DocumentClient(); const tableName = 'myTable'; const itemsToDelete = [ { DeleteRequest: { Key: { id: 'item1', }, }, }, { DeleteRequest: { Key: { id: 'item2', }, }, }, // ... add more items to delete here ]; const params = { RequestItems: { [tableName]: itemsToDelete, }, }; dynamoDb.batchWrite(params, (err, data) => { if (err) { console.error(err); } else { console.log(data); } });
Similar Code Examples
- DynamoDB: Get All Items
- DynamoDB: Get Multiple Items
- DynamoDB: Increment Counter
- DynamoDB: BatchGetItem
- DynamoDB: Bulk Insert
- DynamoDB: Query Greater Than
- DynamoDB: Batch Get
- DynamoDB BatchWriteItem in Typescript
- DynamoDB: Delete Table
- DynamoDB: Query Group By
- DynamoDB: Query Ends With
- DynamoDB: Query Date Range
- DynamoDB: Get Last 10 Records
- DynamoDB: Not Begins With
- DynamoDB: Query KeyConditionExpression
Dynobase is a Professional GUI Client for DynamoDB
Start your 7-day free trial today
Product Features
- New in Dynobase 3.0
- Semantic and Vector Search
- Schema Explorer
- Visual JSON Path Filtering
- Visual Item Diff
- MCP Server for AI Tools
- Use SQL with DynamoDB
- Import CSV To DynamoDB
- Import JSON To DynamoDB
- Export DynamoDB To JSON
- Export DynamoDB To S3
- Export DynamoDB To CSV
- DynamoDB Update Item
- DynamoDB Delete All Items
- DynamoDB Delete Item
- DynamoDB Create Table
- DynamoDB Delete Table
- DynamoDB Conditional Update
DynamoDB Tools
DynamoDB Info
© 2026 Dynobase