I tried DynamoDB docs and work with example using QueryResult
, I couldn't find any source how to using min, max and avg in DynamoDB (I'm using Java API).
These are not provided. You'd implement these by either doing a query or scan with a filter, and calculating the values yourself. To simplify things a bit, you can use the Count
parameter to return only the count of items that would be returned by that query/scan instead of the actual items. (Note that count only returns a partial count - you may need to sum counts across multiple pages of queries/scans).
Alternatively, you can maintain a separate table that stores these values for you as the main tables are updated (note this can be tricky to keep in sync, you'll have to use some form of transaction management and take into account dynamo's eventual consistency model).
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