对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。
Docs 菜单

聚合选项

Dragging a field onto an aggregation encoding channel allows you to use an aggregation pipeline operator on that field.

The aggregation pipeline operators available in the chart builder change based on the data type of the selected field. Atlas Charts categorizes the field data type as either a number, string, or date and displays appropriate aggregation options accordingly.

下表列出了每种数据类型的可用聚合选项:

聚合选项
说明
管道操作

sum

对该字段中的所有值求和。

count

计算在该字段中具有值的文档数量。

count by value

计算字段中不同值的数量,并根据这些值创建一个系列。

distinct

计算字段中唯一值的数量。

Applies $addToSet and counts the number of items in the result set with $size.

mean

计算字段中所有值的平均值。

median

字段中的近似中值。

要使用此聚合选项,您的部署必须使用MongoDB 7.0或更高版本。

min

返回字段中的最小值。

max

返回字段中的最小值。

variance

计算字段中值的样本方差。

Applies $stdDevSamp and raises the result to the 2nd power with $pow.

variance population

计算字段中值的总体方差。

Applies $stdDevPop and raises the result to the 2nd power with $pow.

standard deviation

计算字段中值的样本标准差。

standard deviation population

计算字段值的总体标准偏差。

聚合选项
说明
管道操作

count

计算在该字段中具有值的文档数量。

count by value

计算字段中不同值的数量,并根据这些值创建一个系列。

distinct

计算字段中唯一值的数量。

Applies the $addToSet operator and counts the number of items in the result set with $size.

给本页内容打分