DynamoDB - with AWS SDK
You wrote this code to update an item but get a runtime error:
const { DynamoDBClient, UpdateItemCommand } = require("@aws-sdk/client-dynamodb");
const client = new DynamoDBClient({ region: "us-east-1" });
const params = {
TableName: "Users",
Key: { id: { S: "123" } },
UpdateExpression: "SET age = :a",
ExpressionAttributeValues: { ":a": 30 }
};
const command = new UpdateItemCommand(params);
await client.send(command);
What is the cause of the error?
