Error: DynamoDB Delete Not Working

Answered by Rafal Wilinski
Last updated: October 23rd, 2026
Solution
DeleteItem succeeding without visible change often means the key did not identify an existing item. An unconditional delete of a missing item is successful and idempotent; adding an empty callback does not fix it.
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { DynamoDBDocumentClient, DeleteCommand } from "@aws-sdk/lib-dynamodb";
const db = DynamoDBDocumentClient.from(new DynamoDBClient({}));
const { Attributes } = await db.send(new DeleteCommand({
TableName: "Orders",
Key: { pk: "CUSTOMER#123", sk: "ORDER#42" },
ReturnValues: "ALL_OLD",
}));
console.log(Attributes ? "Deleted an item" : "No item at that key");Use the complete base-table key with the correct names and types. An index key cannot be passed in place of the table key. Verify the account, Region and endpoint if the item still appears elsewhere, and use a strongly consistent base-table read to check immediately after deletion.
A false ConditionExpression rejects the delete and leaves the item intact. A later writer can also recreate it. Capture those cases separately. In legacy SDK v2 use a callback or .promise(); current v3 code awaits send and needs neither a callback nor .promise().
See deleting items and AWS documentation.
Other Common DynamoDB Errors (with Solutions)
- DynamoDB No Provisioned Throughput specified for the table
- DynamoDB Query Limit Not Working
- DynamoDB validation error
- DynamoDB Error All Attributes Must Be Indexed
- DynamoDB consistent read not working
- AWS DynamoDB CredentialsError: Missing credentials in config
- dynamodb table not exists
- boto3 dynamodb unable to locate credentials
- dynamodb cannot read property 'push' of undefined
- dynamodb-admin not working
- DynamoDB no attribute schema defined
- dynamodb: one or more parameter values were invalid: type mismatch for index key
- missing required key 'key' in params dynamodb
- dynamodb query key condition not supported
- DynamoDB error 400
Dynobase is a Professional GUI Client for DynamoDB
Start your 7-day free trial today
Product Features
DynamoDB Tools
- SSH GUI Client
- Chat With Cloud
- MongoDB GUI Client
- AWS Cost Monitoring
- DynamoDB Query Builder
- DynamoDB Code Examples
- DynamoDB Node.js Queries
- DynamoDB JSON Converter
- DynamoDB UUID Generator
- DynamoDB Local Admin GUI
- DynamoDB Pricing Calculator
- DynamoDB Single-Table Design
- Best DynamoDB GUI Clients
- Dynobase vs DynoTable