dynobase-icon
Dynobase

Error: DynamoDB Delete Not Working

Rafal Wilinski

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.

Dynobase is a Professional GUI Client for DynamoDB

Start your 7-day free trial today

Product Features

Download
/
Changelog
/
Pricing
/
Member Portal
/
Privacy
/
EULA
/
Twitter
© 2026 Dynobase
+
Still using AWS DynamoDB Console?
Try Dynobase to accelerate your DynamoDB workflow. Start your 7-day free trial today.