I have a dynamodb table with uid for the hash key and Score for the range key and I am trying to get an element to return. Unfortunately after going through all of the online documentation I could find I am still getting the same error:
AWS Error Message: Either the KeyConditions or KeyConditionExpression parameter must be specified in the request.
$result = $this->client->query(array(
'TableName' => 'Leaderboard',
'KeyConditionExpression' => 'uid = :u_id and Score >= :u_score',
'ExpressionAttributeValues' => array (
':u_id' => array('S' => 'test'),
':u_score' => array('S' => '100')
),
'ConsistentRead' => true
));
print_r($result['Items']);
'KeyConditionExpression' is obviously included within the query parameters. I also tried 'N' => '100' which makes more sense but that did not fix the error which is seemingly unrelated.