Database Reference
In-Depth Information
Using the AWS SDK for PHP
To scan a table in DynamoDB, you need to invoke the scan method from the Dy-
namoDB client, as shown in the following code:
$response = $client->scan(array(
"TableName" => "Book"
));
To use pagination, you need to write code in the following manner:
$tableName = "Book";
do {
$request = array(
"TableName" => $tableName,
"Limit" => 20
);
# Add ExclusiveStartKey if present in previous response
if(isset($response) &&
isset($response['LastEvaluatedKey'])) {
$request['ExclusiveStartKey'] =
$response['LastEvaluatedKey'];
}
$response = $client->scan($request);
} while(isset($response['LastEvaluatedKey']));
Search WWH ::




Custom Search