title: How to do Query in DynamoDB on the basis of HashKey and range Key?
body: <p>I am new to <code>DynamoDb</code> stuff. I just want to know how can we query on a table in DynamoDB with the <code>hashKey</code> and <code>rangeKey</code>.</p>
  
  <p>Let's say my Table is <code>TestTable</code> and it's schema is something like this:</p>
  
  <pre><code>1.Id (HK of type String)
  2 Date (RK of type String )
  3 Name (attribute of type String)
  </code></pre>
  
  <p>Now If I want to query on this table on the basis of <code>hashKey</code> which is <code>Id</code> here, we make a <code>query</code> as :</p>
  
  <p>Let's say my query is to get all Items having <code>Id ="123".</code></p>
  
  <pre><code>TestTable testTable = new TestTable();
  testTable.setId("123");
  
  DynamoDBQueryExpression&lt;TestTable&gt; queryExpression = new DynamoDBQueryExpression&lt;TestTable&gt;()
                                                                  .withHashKeyValues(TestTable)
                                                                  .withConsistentRead(false);
  </code></pre>
  
  <p>Now I want to get all Items having <code>Id ="123" and Date ="1234"</code>.</p>
  
  <p>How can I query this thing in <code>DynamoDB</code></p>
  
  <p>I am using <code>java</code> as my programming language.</p>