看来您正在尝试使用expression更新项目,在这种情况下,您
Updateexpression不正确。无论是
expressionAttributeNames和
expressionAttributevalues用于占位符代替你的表达。
我想如果您想为某项设置属性,您的代码将类似于以下内容:
dynamoDB.updateItem({ "TableName" : "exampleTable", "Key" : { "hashAttributeName" : { "S" : "thing_ID" } }, "Updateexpression" : "SET #attrName =:attrValue", "expressionAttributeNames" : { "#attrName" : "SessionID" }, "expressionAttributevalues" : { ":attrValue" : { "S" : "maybe this works" } }});这将更新一个看起来像这样的项目:
{ "Item":{ "hashAttributeName":"thing_ID" }}对此:
{ "Item":{ "hashAttributeName" : "thing_ID", "SessionID" : "maybe this works" }}


