Conditional Writes DynamoDB: Expected params.ExpressionAttributeValues[‘:p’] to be a structure

Question:

I’m trying to update my DynamoDB table using a conditional write, after read the official doc (https://docs.aws.amazon.com/amazondynamodb/latest/gettingstartedguide/GettingStarted.NodeJs.03.html#GettingStarted.NodeJs.03.05) I’m getting an error, I think this is a Syntax error, but I’m not sure, this is my code:

This run ‘fine’ by I get this error:

I check if the json is valid and I was reading about ExpressionAttributeValues here (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ExpressionPlaceholders.html#ExpressionAttributeNames) but I don’t get info to resolve my problem.

Answer:

Per the documentation, change this:


To:

Leave a Reply