A. ExclusiveStartKey is missing required key attributes.
B. Limit cannot be used with ExclusiveStartKey.
C. TableName is incorrect.
D. Limit value must be greater than 10.
Solution
Step 1: Understand ExclusiveStartKey requirements
ExclusiveStartKey must include the full primary key attributes exactly as stored in the table.
Step 2: Identify error cause
If the provided ExclusiveStartKey lacks required key attributes or has wrong format, DynamoDB returns an error.
Final Answer:
ExclusiveStartKey is missing required key attributes. -> Option A
Quick Check:
ExclusiveStartKey needs full primary key [OK]
Hint: ExclusiveStartKey must have full primary key attributes [OK]
Common Mistakes:
Thinking Limit and ExclusiveStartKey cannot be combined
Assuming TableName typo causes this error
Believing Limit must be > 10
5. You want to fetch all items from a large DynamoDB table but only 4 items at a time to avoid timeouts. Which approach correctly implements pagination?
hard
A. Use Limit: 4 and pass LastEvaluatedKey from previous response as ExclusiveStartKey in next query.
B. Use Limit: 4 and always start query with ExclusiveStartKey: null.
C. Use Limit: 4 and increase Limit by 4 each time to get next items.
D. Use Limit: 4 and scan the whole table once without ExclusiveStartKey.
Solution
Step 1: Understand pagination with Limit and ExclusiveStartKey
Limit controls how many items are returned per request. To get next items, use ExclusiveStartKey with LastEvaluatedKey from previous response.
Step 2: Confirm correct pagination process
Use Limit: 4 and pass LastEvaluatedKey from previous response as ExclusiveStartKey in next query to fetch items in pages. Restarting from the beginning, increasing Limit, or scanning without pagination leads to repeated or incomplete results.
Final Answer:
Use Limit: 4 and pass LastEvaluatedKey from previous response as ExclusiveStartKey in next query. -> Option A