title: Query DynamoDB with case-insensitive condition
body: <p>We're storing organization names in a DynamoDB table on AWS, and would like to maintain official capitalization in those business names, for example in "TNT" and "FedEx".</p>
  
  <p>Our use case is that users of the application can search for organizations by name, but we'd like that their queries are interpreted case-insensitively. So, queries for "FedEx", "Fedex" or "fedex" should all return the correct item in the table.</p>
  
  <p>Other databases have ways to perform queries ignoring case (for example by the <code>ILIKE</code> key word in PostgreSQL), by expressing queries via regular expressions, or by applying functions in the condition (for example the  <code>LOWER()</code> function).</p>
  
  <p>How can this be done in DynamoDB? The <a href="http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html" rel="noreferrer">documentation on Amazon DynamoDB's Query</a> does not provide an answer.</p>
  
  <p>(The best work-around seems to be storing the name twice: once with the official capitalization in effect, and once in another field with the name converted to lowercase. Searching should then be done on the latter field, with the query search term also converted to lowercase. Yes, I know it adds redundancy to the table. It's a work-around, not an optimal solution.)</p>