【发布时间】:2016-01-21 13:57:10
【问题描述】:
我需要使用相应的键将字符串附加到 dynamodb 表中的字符串集。这是我用来做 updateItem 的更新表达式:
var params = {
"TableName" : tableName,
"Key": {
"ID": {
S: "20000"
}
},
"UpdateExpression" : "SET #attrName = list_append(#attrName, :attrValue)",
"ExpressionAttributeNames" : {
"#attrName" : "entries"
},
"ExpressionAttributeValues" : {
":attrValue" : {"SS":["000989"]}
} };
这在我使用 aws cli 执行 updateItem() 时有效。但是在 nodejs 中使用 aws-sdk 时,出现错误:
Invalid UpdateExpression: Incorrect operand type for operator or function; operator or function: list_append, operand type: M\n
有什么帮助吗? 谢谢
【问题讨论】:
-
您是否尝试过将 :attrValue 的值更改为
{"L":[{"S":"000989"}]} -
或者,您的表中
entries的类型是什么?
标签: node.js amazon-web-services amazon-dynamodb aws-sdk