AWS NodeJS SDK V3 DynamoDB UpdateItem — TypeError: Cannot read property ‘0’ of undefined \n at Object.AttributeValue.visit
Jul 9, 2021
Hi there, if you are running into this issue, you are at the right place to fix this and I hope I can help you.
With DynamoDB v3 is a bit different when it comes to defining your params object.
Error message:
Solutions:
- Make sure your key format is correct by including the type of your key. For example: PK: { S: `USER#1234` }
- Make sure ExpressionAttributeValues is also including the type of your key. For example: “:title”: { S: body.title }
Example:
Please let me know if you still have an issue via Twitter or LinkedIn