I have a table with the following fields in dynamoDB:
I want to fetch all documents corresponding to a reference_number with isEligible as true. I am doing this using a query, with a range condition on isEligible field. I now want the results of this query to be returned in order sorted by score field. Is there a way I can achieve this? All of this is being done in java
As currently modeled, no.
If had a LSI with a composite sort key, ex:
"true#85"
"true#100"
"false#45"
You could then use a begins_with
in your Query().