How to get item count from DynamoDB?

前端 未结 12 2271
故里飘歌
故里飘歌 2020-12-04 17:15

I want to know item count with DynamoDB querying.

I can querying for DynamoDB, but I only want to know \'total count of item\'.

For example, \'SELECT COUNT(*

12条回答
  •  情歌与酒
    2020-12-04 17:57

    If you happen to reach here, and you are working with C#, here is the code:

    var cancellationToken = new CancellationToken();
    
    var request = new ScanRequest("TableName") {Select = Select.COUNT};
    
    var result = context.Client.ScanAsync(request, cancellationToken).Result;
    
    totalCount = result.Count;
    

提交回复
热议问题