In my DynamoDB table my primary key is composed of a partition key (documentId - string) and sort key (revision - string).
documentId | revision | details (JSON)
A | 5 | { title: "Where's Wally New" }
A | 2 | { title: "Where's Wally" }
B | 3 | { title: "The Grapes of Wrath" }
C | 4 | { title: "The Great Gatsby" }
For a set of documentIds, I want to grab the latest revisions of those documents, as defined by the sort key. For example, I want to get the details of the latest revisions for documentId (A, B). This should return ("Where's Wally New", "The Grapes of Wrath").
I've managed to find people confirming you do this efficiently if you are just looking up one hash key/documentId at a time (e.g. NoSQL: Getting the latest values from tables DynamoDB/Azure Table Storage), but if I want to avoid having to make multiple read queries is this possible?