简体   繁体   English

AWS SDK v3 TransactWriteItemsCommand 类型错误:无法读取未定义的属性“0”

[英]AWS SDK v3 TransactWriteItemsCommand TypeError: Cannot read property '0' of undefined

I am trying to use TransactWriteItemsCommand to work using the new AWS SDK V3 for NodeJS.我正在尝试使用 TransactWriteItemsCommand 来使用适用于 NodeJS 的新 AWS SDK V3。 Unfortunately I can't find an example and the docs are not really well documented yet.不幸的是,我找不到一个例子,而且文档还没有很好的记录。

This is my params object:这是我的参数 object:

    {
        "TransactItems": [
            {
                "Update": {
                    "TableName": "boxes",
                    "Key": {
                        "id": "36"
                    },
                    "UpdateExpression": "set isOpen = :isOpen",
                    "ExpressionAttributeValues": {
                        ":isOpen": {
                            "BOOL": true
                        }
                    }
                }
            },
            {
                "Update": {
                    "TableName": "boxes",
                    "Key": {
                        "id": "33"
                    },
                    "UpdateExpression": "set isOpen = :isOpen",
                    "ExpressionAttributeValues": {
                        ":isOpen": {
                            "BOOL": true
                        }
                    }
                }
            }
        ]
    }

What I'm doing wrong?我做错了什么? Any help would be appreciated!任何帮助,将不胜感激!

Thanks to @flanamacca for the answer感谢@flanamacca 的回答

The problem is the format of the key because I'm not using DynamoDB JSON format.问题是密钥的格式,因为我没有使用 DynamoDB JSON 格式。

   "Key": {
    "id": {"S": "36"}
   },

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 TypeError:无法读取未定义的AWS-SDK ec2的属性“发送” - TypeError: Cannot read property 'send' of undefined AWS-SDK ec2 AWS Lambda TypeError:无法读取未定义的属性“ toString” - AWS lambda TypeError: Cannot read property 'toString' of undefined Actions Sdk 收到此错误类型错误:无法读取未定义的属性“输出” - Actions Sdk get this error TypeError: Cannot read property 'output' of undefined 类型错误:无法读取 V2Agent.addActionsOnGoogle_ 处未定义的属性“forEach” - TypeError: Cannot read property 'forEach' of undefined at V2Agent.addActionsOnGoogle_ v-on 处理程序中的错误(Promise/async):“TypeError:无法读取未定义的属性“数据””//未定义 - Error in v-on handler (Promise/async): “TypeError: Cannot read property 'data' of undefined” // undefined UnhandledPromiseRejectionWarning TypeError:无法读取未定义的属性“属性” - UnhandledPromiseRejectionWarning TypeError: Cannot read property 'property' of undefined Next.js 和 Sanity V3 Studio 未处理的运行时错误:类型错误:无法读取未定义的属性(读取“调用”) - Next.js and Sanity V3 Studio Unhandled Runtime Error: TypeError: Cannot read properties of undefined (reading 'call') 使用Node.js SDK调用链码时出错[TypeError:无法读取未定义的属性'getConnectivityState' - Error invoking chaincode using Node.js SDK [TypeError: Cannot read property 'getConnectivityState' of undefined] TypeError:无法读取未定义的属性“方法” - TypeError: Cannot read property 'method' of undefined 类型错误:无法读取 nodeJS 中未定义的属性“findIndex” - TypeError: Cannot read property 'findIndex' of undefined in nodeJS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM