I have a DynamoDB table with feed_guid
as the global secondary index. I want to query with a set of feed_guid
in that table. Since feed_guid
is not my primary keys, I can't use getBatchItem
. When I tried the following method, I got this error:
Invalid operator used in KeyConditionExpression: OR
$options = array(
'TableName' => 'feed',
'IndexName' => 'GuidIndex',
'KeyConditionExpression' => 'feed_guid = :v_guid1 or feed_guid = :v_guid2',
'ExpressionAttributeValues' => array (
':v_guid1' => array('S' => '8a8106e48bdbe81bf88d611f4b2104b5'),
':v_guid2' => array('S' => '19cab76242a6d85717de64fe4f8acbd4')
),
'Select' => 'ALL_ATTRIBUTES',
);
$response = $dynamodbClient->query($options);