title: Querying Dynamodb using LSI with partition key and range key
body: <p>In DynamoDB I configured LSI(Local Secondary Index) using a Partition Key and Range Key.</p>
  
  <p>How can I Query DynamoDB Table with Partition Key value and Range Key value ? </p>
  
  <p>In SQL, I can use the <strong>IN</strong> operator:</p>
  
  <pre><code>SELECT *
    FROM genericTable
   WHERE partionKey = "foo"
     AND rangeKey IN ("bar1", "bar11", "bar5")
  </code></pre>
  
  <p>How do I achieve this functionality in DynamoDB ?</p>
  
  <p>As Per <a href="http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html#API_Query_RequestSyntax" rel="nofollow noreferrer">Documentation of Amazon query</a> </p>
  
  <blockquote>
    <p>Query can use KeyConditionExpression to retrieve ... several items
    that have the same partition key value but different sort key values.</p>
  </blockquote>
  
  <p>However in the list of valid comparison operators, there is nothing analogous to SQL "IN". </p>
  
  <p>Is there any way to use multiple key condition expressions like below SQL ?</p>
  
  <pre><code>SELECT *
    FROM genericTable
   WHERE partionKey = "foo"
     AND (rangeKey = "bar1"
      OR rangeKey = "bar5" ....)
  </code></pre>