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?
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
BatchGetItemoperation returns the attributes of one or more items from one or more tables. You identify requested items by primary key.