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: Bulk Insert
- DynamoDB: Get Last 10 Records
- DynamoDB: Query Global Secondary Index in Nodejs
- DynamoDB: Delete All Items With Partition Key
- DynamoDB: Query Group By
- DynamoDB: Get Query
- DynamoDB: Attribute Not Null
- DynamoDB: Delete Multiple Items in Javascript
- DynamoDB: Like
- DynamoDB: Query Greater Than
- DynamoDB: Get All Items
- DynamoDB: Query KeyConditionExpression
- DynamoDB: Query Count
- DynamoDB: Get Last Inserted Item
- DynamoDB: Not Between
Spend less time in the AWS console, use Dynobase.
Try 7-day free trial. No credit card needed.
Product Features
DynamoDB Tools
DynamoDB Info
© 2024 Dynobase