title: Querying DynamoDB without Primary Key
body: <p>I need to query a DynamoDB table by a key different than its Primary Key.  I tried to create a Global Secondary Index for it.  However I get this error: "query key condition not supported dynamodb".  By seeing some examples, it looks like I can't query by a secondary index unless I also include the primary index/key, is this correct?  Let's say I need to query by all employees that work in a certain city, can I do that without the employeeID?  </p>
  
  <p><strong>Updated info</strong>
  Maybe my index is not created as it should?</p>
  
  <p>Table info:</p>
  
  <ul>
  <li>id-->Primary partition key</li>
  <li>primary sort key-->name</li>
  </ul>
  
  <p>GSI:</p>
  
  <ul>
  <li>Partition Key/primary key--> city</li>
  <li>Projected-->All</li>
  </ul>
  
  <p>When I query from node I sent as a parameter the city, and the index name:</p>
  
  <pre><code>    const filter = { city: city};
      return this.getRecordsFromDb(filter, { IndexName: "myIndexName" })
          .then(records =&gt; __.head(records));
  </code></pre>