How can I get the total number of items in a DynamoDB table?

前端 未结 8 2027
南旧
南旧 2020-12-05 23:33

I want to know how many items are in my dynamodb table. From the API guide, one way to do it is using a scan as follows:



        
8条回答
  •  失恋的感觉
    2020-12-06 00:13

    Aha, there is a Count option in the scan API, see http://docs.amazonwebservices.com/AWSSDKforPHP/latest/#m=AmazonDynamoDB/scan

    scan(array(
        'TableName' => 'ProductCatalog'
        'Count'     => true,
    ));
    
    echo "Count: ".$scan_response->body->Count."\n";
    

提交回复
热议问题