Error: DynamoDB Update Not Working

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.
Other Common DynamoDB Errors (with Solutions)
- DynamoDB Network Error: self signed certificate in chain
- dynamodb ttl not deleting / erasing items
- dynamodb the parameter cannot be converted to a numeric value NaN
- dynamodb cannot read properties of undefined
- sls dynamodb install not working
- DynamoDB stream lambda error
- accessdeniedexception dynamodb
- AWS CLI DynamoDB Error Parsing Parameter
- dynamodb list_append if_not_exists not working
- DynamoDB ConditionExpression not working
- DynamoDB Not Supported Requires @DynamoDBTyped Or @DynamoDBTypeConverted
- name key is not defined dynamodb
- dynamodb table did not stabilize
- dynamodb system errors metric
- DynamoDB cannot do operations on a non-existent table
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