I fetch all items from dynamodb with the following query. It works fine. i create these function generic in zend framework and access these functions over the project.
public function getQuerydata($tablename, $filterKey, $filterValue){
return $this->getQuerydataWithOp($tablename, $filterKey, $filterValue, 'EQ');
}
public function getQuerydataWithOp($tablename, $filterKey, $filterValue, $compOperator){
$result = $this->getClientdb()->query(array(
'TableName' => $tablename,
'IndexName' => $filterKey,
'Select' => 'ALL_ATTRIBUTES',
'KeyConditions' => array(
$filterKey => array(
'AttributeValueList' => array(
array('S' => $filterValue)
),
'ComparisonOperator' => $compOperator
)
)
));
return $result['Items'];
}
//Below i Access these functions and get data.
$accountsimg = $this->getQuerydataWithPrimary('accounts', 'accountID',$msgdata[0]['accountID']['S']);