1

I'm using the documentClient to work with dynamodb.

I have an array of the primary keys.

What method should I use, Scan or Query to get items?

1 Answer 1

0

If you have a list of primary key values, you should use the BatchGetItem API. Query does not really help you are, and a Scan is unneeded because you already know the primary keys to index into.

The BatchGetItem operation returns the attributes of one or more items from one or more tables. You identify requested items by primary key.

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

2 Comments

Thank you! However, I am going to use Scana and the FilterExpression because I have the secondary key in my table.
thank you for this answer - stackoverflow.com/a/30220138/6108211

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.