ngzhongcai
ngzhongcai

Reputation: 2043

AWS DynamoDB. Querying all hashes IN array

I know BatchGetItems allows for retrieval of multiple hash keys. To save on the read capacity, I like to know if Query provide same functionality via some "IN" keyword I can use? ie, all primary keys will be inserted into an array for Query to search "IN" in the array.

Upvotes: 1

Views: 639

Answers (1)

ketan vijayvargiya
ketan vijayvargiya

Reputation: 5659

Query doesn't provide what you want. As per the documentation here:

KeyConditionExpression: The condition must perform an equality test on a single partition key value. The condition can also perform one of several comparison tests on a single sort key value. Query can use KeyConditionExpression to retrieve one item with a given partition key value and sort key value, or several items that have the same partition key value but different sort key values.

BatchGetItem is the only option that you have.

Upvotes: 2

Related Questions