在DynamoDB中查找平均值和总和? [英] Find Average and Total sum in DynamoDB?

查看:120
本文介绍了在DynamoDB中查找平均值和总和?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取packSOC和totalKw的总和和平均值?

How can I get sum and average of packSOC and totalKw?

我将dynamoDB用作数据库,但据我所知dynamoDB不支持聚合.如何获得packSOC和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].

推荐答案

目前DynamoDB不支持此聚合功能.

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.

如果您需要这样的功能,DynamoDB可能不是您的理想选择,并且您应该查看类似的数据库,例如 MongoDB 确实具有强大的聚合框架.他们确实提供了云托管版本,也称为

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

这篇关于在DynamoDB中查找平均值和总和?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆