3

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 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

2 Comments

My query is complicated and this did help. I updated the question with the Exception I now receive.
May I suggest you roll back the changes to your question, as this answer now makes no sense. If you post this as a new question I will answer it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.