If I'm not mistaken, to perform a count of items, in DynamoDB we have to use the query action and provide Select: 'COUNT'
as parameter. Let's consider that I'd like to count the number of items that have a certain partition key. Given that we have to use the query
action, does that mean the following?:
The answer is yes, to both your questions.
That is apparent from these two points from the documentation:
If you used a QueryFilter in the request, then Count is the number of items returned after the filter was applied, and ScannedCount is the number of matching items before the filter was applied.
If you did not use a filter in the request, then Count and ScannedCount are the same.
You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With