2
votes

I'm trying to use the query expression an getting

ATTEMPT EDIT - 1 PASS An error occurred (ValidationException) when calling the Query operation: Invalid KeyConditionExpression: Syntax error; token: "{", near: "{""

This query looks like

aws dynamodb query --table-name name-of-table --key-condition-expression 'id=:91'

I've tried '"id"="91"', ':id=":91"', etc.

id is the partition key so this is also the required attribute needed.

1

1 Answers

3
votes

Try this

aws dynamodb query --table-name name-of-table --key-condition-expression 'id = :idval' --expression-attribute-values '{":idval":{"S":"91"}}'

You have to use value substitution on attributes. You can optionally use attribute name substitution.

Note i've assume your id attribute is of type String. Change it to "N" if its a number.