Database Manual / Aggregation Operations / Reference

Aggregation Database Commands and Methods聚合数据库命令和方法

Note

For details on a specific command, including syntax and examples, click on the link to the command's reference page.有关特定命令的详细信息,包括语法和示例,请单击指向该命令参考页面的链接。

Aggregation Commands聚合命令

Name名称Description描述
aggregatePerforms aggregation tasks such as $group using an aggregation pipeline.使用聚合管道执行聚合任务,如$group
countCounts the number of documents in a collection or a view.
distinctDisplays the distinct values found for a specified key in a collection or a view.显示集合或视图中指定键的不同值。
mapReducePerforms map-reduce aggregation for large data sets.对大型数据集执行map-reduce聚合。

Aggregation Methods聚合方法

Name名称Description描述
db.collection.aggregate()Provides access to the aggregation pipeline.提供对聚合管道的访问。
db.collection.mapReduce()Performs map-reduce aggregation for large data sets.对大型数据集执行map-reduce聚合。