MongoDB:聚合之累加操作符

参看原文。

官网:https://docs.mongodb.com/manual/reference/operator/aggregation/group/#considerations

累加操作符

名字描述
$avgReturns an average of numerical values. Ignores non-numeric values.(返回平均值)
$firstReturns a value from the first document for each group. Order is only defined if the documents are in a defined order.(返回第一个)
$lastReturns a value from the last document for each group. Order is only defined if the documents are in a defined order.(返回最后一个)
$maxReturns the highest expression value for each group.(返回最大值)
$minReturns the lowest expression value for each group.(返回最小值)
$pushReturns an array of expression values for each group.
$addToSetReturns an array of unique expression values for each group. Order of the array elements is undefined.()
$stdDevPopReturns the population standard deviation of the input values.
$stdDevSampReturns the sample standard deviation of the input values.
$sumReturns a sum of numerical values. Ignores non-numeric values.(返回总和)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值