kitar / laravel-dynamodb

A DynamoDB based Eloquent model and Query builder for Laravel.
MIT License
179 stars 27 forks source link

Add model `count()` support #49

Open hschimpf opened 4 months ago

hschimpf commented 4 months ago

Allow to get a model's count.

DynamoDB allows to specify which attributes will be returned in the query. But also has the special value COUNT to get only the count of items.

The used read capacity units is the same as fetching the items, but the payload isn't. In some cases is useful to fetch only the count of items in order to reduce the bandwidth used. It's also useful to bypass the 1MB limit of responses