Installation guide

echo $item['error']['S'] . "\n";
}
Scan
A scan operation scans the entire table. You can specify filters to apply to the results to refine the values returned to
you, after the complete scan. Amazon DynamoDB puts a 1MB limit on the scan (the limit applies before the results
are filtered).
A scan can be useful for more complex searches. For example, we can retrieve all of the errors in the last 15
minutes that contain the word "overflow":
$iterator = $client->getIterator('Scan', array(
'TableName' => 'errors',
'ScanFilter' => array(
'error' => array(
'AttributeValueList' => array(array('S' => 'overflow')),
'ComparisonOperator' => 'CONTAINS'
),
'time' => array(
'AttributeValueList' => array(
array('N' => strtotime('-15 minutes'))
),
'ComparisonOperator' => 'GT'
)
)
));
// Each item will contain the attributes we added
foreach ($iterator as $item) {
// Grab the time number value
echo $item['time']['N'] . "\n";
// Grab the error string value
echo $item['error']['S'] . "\n";
}
Deleting a table
Warning
Deleting a table will also permanently delete all of its contents.
Now that you've taken a quick tour of the PHP client for Amazon DynamoDB, you will want to clean up by deleting
the resources you created.
$client->deleteTable(array(
'TableName' => 'errors'
));
$client->waitUntilTableNotExists(array(
'TableName' => 'errors'
));
Using the WriteRequestBatch
You can use the WriteRequestBatch if you need to write or delete many items as quickly as possible. The
WriteRequestBatch provides a high level of performance because it converts what would normally be a separate
HTTP request for each operation into HTTP requests containing up to 25 comparable requests per transaction.
Amazon DynamoDB (2011-12-05)
78