相关疑难解决方法(0)

DynamoDB:SET list_append使用aws sdk无法正常工作

我需要使用相应的键将字符串附加到dynamodb表中的字符串集.这是我用来执行updateItem的Update表达式:

  var params = {
    "TableName" : tableName,
    "Key": {
      "ID": {
        S: "20000"
      }
    },
    "UpdateExpression" : "SET #attrName = list_append(#attrName, :attrValue)",
    "ExpressionAttributeNames" : {
      "#attrName" : "entries"
    },
    "ExpressionAttributeValues" : {
      ":attrValue" : {"SS":["000989"]}
    }   };
Run Code Online (Sandbox Code Playgroud)

这在我使用aws cli执行updateItem()时有效.但是当在nodejs中使用aws-sdk时,我收到错误:

Invalid UpdateExpression: Incorrect operand type for operator or function; operator or function: list_append, operand type: M\n
Run Code Online (Sandbox Code Playgroud)

有帮助吗?谢谢

amazon-web-services node.js amazon-dynamodb aws-sdk

19
推荐指数
2
解决办法
1万
查看次数