How I can get items from DynamoDBIndexHashKey?
<p>I would like to specify. May I receive elements only from <code>DynamoDBIndexHashKey</code>, not use <code>DynamoDBHashKey</code>?  </p>

<p>I have a table with fields </p>

<pre><code>@DynamoDBIndexHashKey (attributeName = "count", globalSecondaryIndexName = "count-index")
@DynamoDBHashKey(attributeName="cluster_output_Id)"
@DynamoDBRangeKey(attributeName="last_fetch)"  
</code></pre>

<p>I have no @DynamoDBIndexRangeKey</p>

<p>It's code:</p>

<pre><code> MyEntity myEntity = new MyEntity();
    myEntity.setCount(1);    // Integer
    DynamoDBQueryExpression&lt;NewsDynamoDb&gt; queryExpression = new DynamoDBQueryExpression&lt;NewsDynamoDb&gt;()
            .withHashKeyValues(myEntity)
            .withIndexName("count-index");
    queryExpression.setConsistentRead(false);
    List&lt;MyEntity&gt; myCollection = mapper.query(MyEntity.class, queryExpression);
</code></pre>

<p>Error:</p>

<pre><code>AmazonServiceException: Status Code: 400, AWS Service: AmazonDynamoDBv2, AWS Request ID: I97S04LDGO6FSF56OCJ8S3K167VV4KQNSO5AEMVJF66Q9ASUAAJG, AWS Error Code: ValidationException, AWS Error Message: One or more parameter values were invalid: Invalid number of argument(s) for the EQ ComparisonOperator
</code></pre>

<p>How I can get items from <code>DynamoDBIndexHashKey</code>?</p>

<p>P.s. Scan - work but not interesting to me, because in a further I want a sorting
Query with DynamoDBHashKey work. I have problems with DynamoDBIndexHashKey </p>

<p><a href="https://stackoverflow.com/questions/30457820/how-to-query-a-dynamo-db-having-a-gsi-with-only-hashkeys-using-dynamodbmapper">same example</a></p>