In DynamoDB my query is not working with ComparisonOperator other than EQ
in PHP. I am using Global Secondary Indexes:
$response = $client->query(array(
"TableName" => $tableName,
"IndexName" => "topRating", // GSI index name
"KeyConditions" => array(
"rating" => array(
"ComparisonOperator" => "NE", // Only 'EQ' works
"AttributeValueList" => array(
array(Type::STRING => "1186") // Sample value
)
)
),
"ScanIndexForward" => true,
"limit" => 5
));
When creating the table I used rating
as hash key for creating topRating
GSI
The response is as follows:
Fatal error: Uncaught Aws\DynamoDb\Exception\ValidationException: AWS Error Code: ValidationException, Status Code: 400, AWS Request ID: XXXXXYYYYYZZZZ, AWS Error Type: client, AWS Error Message: Attempted conditional constraint is not an indexable operation, User-Agent: aws-sdk-php2/2.7.0 Guzzle/3.9.2 curl/7.19.7 PHP/5.4.30 thrown in ....