How can I get sum and average of packSOC and totalKw?
I am using dynamoDB as database but in my understanding dynamoDB does not support aggregate. How can I get average and sum of packSOC and totalKw.[Not possible to use for loop on result because result has so many data in it].
At this time DynamoDB doesn't support this aggregation features.
If you want to collect these values you either have to keep track of them elsewhere or do the very inefficient collection scan and calculate it. Even if you reduce the output using projections that's likely not feasible.
If you need such functionality DynamoDB might not be a good pick for you and you should look at similar databases like MongoDB which does have a powerful aggregation framework. They do offer a cloud hosted version as well called MongoDB Atlas
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