3

I have a range key field that is also an GSI. Does anybody know how to annotate this attribute with DynamoDBMapper?

FYI, I tried putting both @DynamoDBRangeKey and @DynamoDBIndexHashKey annotations on like below, and it gave an "no RANGE key value present" error while querying data.

@DynamoDBRangeKey(attributeName = POOL_HOST)
@DynamoDBIndexHashKey(attributeName = POOL_HOST,
            globalSecondaryIndexName = POOL_HOST_GSI)
String poolhost;
  • This question seems to be for some specific framework used to access DynamoDB. Adding that to tags list will help others find your question. – kaskelotti Jul 04 '19 at 12:51
  • @kaskelotti, DynamoDBMapper is the high-level java SDK provided by AWS. The current tags should be fine. – Matthew Pope Jul 04 '19 at 15:50
  • 1
    Can you include the query you’re using, the complete key attributes for the table and the index, and the code you’re using to make the query? The error message suggests that it’s not a problem with the model definition, but that there’s some expected value that is not present. – Matthew Pope Jul 04 '19 at 15:55

0 Answers0