Skip to content

UpdateItem

Source: src/AWS/DynamoDB/UpdateItem.ts

Runtime binding for dynamodb:UpdateItem.

Bind this operation to a Table inside a function runtime to get a callable that applies an update expression to a single item, automatically injecting the table name. Provide the UpdateItemHttp layer on the Function to satisfy the binding.

const updateItem = yield* AWS.DynamoDB.UpdateItem(table);
const response = yield* updateItem({
Key: {
pk: { S: "user#123" },
sk: { S: "profile" },
},
UpdateExpression: "SET #name = :name",
ExpressionAttributeNames: { "#name": "name" },
ExpressionAttributeValues: { ":name": { S: "Alice" } },
ReturnValues: "ALL_NEW",
});