'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. Unfortunately I can't find an example and the docs are not really well documented yet.

This is my params 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!



Solution 1:[1]

Thanks to @flanamacca for the answer

The problem is the format of the key because I'm not using DynamoDB JSON format.

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1