Owen Wang
Owen Wang

Reputation: 1

aws dynamodb query error: Query key condition not supported

Here is my question: I read from amazon dynamodb api that the condition IN for query means Checks for matching elements in a list*, but why it returns an error : **Query key condition not supported?

aws dynamodb query --table-name Music --key-conditions '{"Artist": {"AttributeValueList": [{ "S": "Wangdong"}, {"S":"Acme Band"} ], "ComparisonOperator": "IN" }}' --endpoint-url http://localhost:8000

An error occurred (ValidationException) when calling the Query operation: Query key condition not supported

Upvotes: 0

Views: 1530

Answers (2)

Owen Wang
Owen Wang

Reputation: 1

As the --key-conditions is a legacy parameter, I think there is no need to get to the bottom for IN condition.

Upvotes: 0

Chris White
Chris White

Reputation: 1447

That is because it is a legacy parameter:

--key-conditions (map)

This is a legacy parameter. Use KeyConditionExpression instead. For more information, see key-conditions in the Amazon DynamoDB Developer Guide

Look instead into using --key-condition-expression as per the documentation (sorry there's no HTML element ID so I can't direct link to it).

Upvotes: 2

Related Questions