DynamoDB: Delete (Guide w/ Code Examples)
Provided by Rafal Wilinski
To delete an item from a DynamoDB table, you can use the delete
method of the DynamoDB DocumentClient
.
const AWS = require('aws-sdk'); const dynamoDb = new AWS.DynamoDB.DocumentClient(); const tableName = 'myTable'; const key = { id: '123' }; const params = { TableName: tableName, Key: key, }; dynamoDb.delete(params).promise() .then(() => { console.log(Item with id ${key.id} deleted successfully ); }) .catch(err => { console.error(err); });
Similar Code Examples
- DynamoDB: Get List Of Items
- DynamoDB: Get Multiple Items
- DynamoDB: Not Begins With
- DynamoDB: BatchGetItem
- DynamoDB: Get All Items
- DynamoDB: Bulk Insert
- DynamoDB: Get Query
- DynamoDB: Delete Multiple Items in Javascript
- DynamoDB: Create if Not Exists
- DynamoDB: Query KeyConditionExpression
- DynamoDB: Like
- DynamoDB: Query Group By
- DynamoDB: Query Greater Than
- DynamoDB: Get Unique Values
- DynamoDB: Get By ID
Spend less time in the AWS console, use Dynobase.
Start your 7-day free trial today
Product Features
DynamoDB Tools
DynamoDB Info
© 2024 Dynobase