1

I have table defined with two column, column 1 is the hash key and column 2 is the range key. I want to get all items defined with the same hash key (so the range key doesn't matter).

I tried to use the new KeyPair().withHashKey(k). But it will throw exception saying that no RANGE key value present.

Is the only option I have is to do a scan for the table to achieve this?

1 Answer 1

5

I think the problem is that you are trying to use the GetItem call, which requires the complete key, and only returns one item. You need to use the Query call, and pass in a KeyExpression that only includes the partition key.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.