dynobase-icon
Dynobase

Error: DynamoDB Update Not Working

Rafal Wilinski

Answered by Rafal Wilinski

Last updated: October 23rd, 2026

Solution

An update that fails or appears unchanged needs the actual exception and returned values. Common causes include an incomplete key, an invalid UpdateExpression, a false condition or a read from another environment.

import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { DynamoDBDocumentClient, UpdateCommand } from "@aws-sdk/lib-dynamodb";

const db = DynamoDBDocumentClient.from(new DynamoDBClient({}));

const { Attributes } = await db.send(new UpdateCommand({
  TableName: "Orders",
  Key: { pk: "CUSTOMER#123", sk: "ORDER#42" },
  UpdateExpression: "SET #status = :status",
  ConditionExpression: "attribute_exists(pk)",
  ExpressionAttributeNames: { "#status": "status" },
  ExpressionAttributeValues: { ":status": "SHIPPED" },
  ReturnValues: "ALL_NEW",
}));
console.log(Attributes);

Supply both key attributes when the table has a sort key, and match their stored types. Aliases protect reserved or special attribute names. ReturnValues defaults to NONE, so an empty successful response is normal without ALL_NEW.

UpdateItem can create an item when the key does not exist. The condition above deliberately prevents that; a condition failure needs investigation, not automatic removal of the guard. You cannot update primary-key values in place. For nested paths, parent maps must exist and updated paths must not overlap.

See update guidance 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.