# 聚合命令

在本页面

* [聚合命令](#id1)
* [聚合方法](#aggregation-methods)

  > **\[success] 注意**
  >
  > 有关特定运算符的详细信息，包括语法和示例，请单击特定的运算符以转到其参考页面。

## 聚合命令

| 名称                                                                      | 描述                                                  |
| ----------------------------------------------------------------------- | --------------------------------------------------- |
| [aggregate](/aggregation/aggregation-reference/aggregation-commands.md) | 使用聚合框架执行聚合任务，例如 group。                              |
| [count](/aggregation/aggregation-reference/aggregation-commands.md)     | 计算集合或视图中的文档数。                                       |
| [distinct](/aggregation/aggregation-reference/aggregation-commands.md)  | 显示在集合或视图中为指定 key 找到的不同值。                            |
| [mapReduce](/aggregation/aggregation-reference/aggregation-commands.md) | 对大型数据集执行[map-reduce](/aggregation/map-reduce.md)聚合。 |

## 聚合方法

| 名称                                                                                                                                                                                                                  | 描述                                                  |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| [db.collection.aggregate()](/can-kao/mongo-shell-methods/collection-methods/db-collection-aggregate.md)                                                                                                             | 提供对[聚合管道](/aggregation/aggregation-pipeline.md)的访问。 |
| [db.collection.mapReduce()](https://github.com/mongodb-china/MongoDB-CN-Manual/tree/8490376c81d56eff95abbaddc6ee414b1e1c9705/docs/docs/Reference/mongo-Shell-Methods/Collection-Methods/db-collection-mapReduce.md) | 对大型数据集执行[map-reduce](/aggregation/map-reduce.md)聚合。 |

译者：李冠飞

校对：李冠飞


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mongoing.com/aggregation/aggregation-reference/aggregation-commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
