How to do Query in DynamoDB on the basis of HashKey and range Key?

后端 未结 3 2388
盖世英雄少女心
盖世英雄少女心 2021-02-19 11:08

I am new to DynamoDb stuff. I just want to know how can we query on a table in DynamoDB with the hashKey and rangeKey.

Let\'s say

3条回答
  •  自闭症患者
    2021-02-19 11:39

    If you're not using index, you should have exact one item, if any, whose Id ="123" and Date ="1234".

    For the exact hash key and range key (in case of = operator), you don't need a query operation. Please have a loot at GetItem API, which is nifty. See documentation page.

    And if you need non-EQ operator for range key (e.g. >=), you can use key condition expression in Query operation: Id = :id and Date >= :date.

提交回复
热议问题