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.
下表列出了每种数据类型的可用聚合选项:
数字
聚合选项 | 说明 | 管道操作 |
|---|---|---|
| 对该字段中的所有值求和。 | |
| 计算在该字段中具有值的文档数量。 | |
| 计算字段中不同值的数量,并根据这些值创建一个系列。 | |
| 计算字段中唯一值的数量。 | |
| 计算字段中所有值的平均值。 | |
| 字段中的近似中值。 要使用此聚合选项,您的部署必须使用MongoDB 7.0或更高版本。 | |
| 返回字段中的最小值。 | |
| 返回字段中的最小值。 | |
| 计算字段中值的样本方差。 | Applies |
| 计算字段中值的总体方差。 | Applies |
| 计算字段中值的样本标准差。 | |
| 计算字段值的总体标准偏差。 |