Overview概述
In this section, you can find complete tutorials that provide detailed explanations of common aggregation tasks in a step-by-step format. The tutorials are adapted from examples in the book Practical MongoDB Aggregations by Paul Done.在本节中,您可以找到完整的教程,这些教程以分步的形式详细解释了常见的聚合任务。这些教程改编自Paul Done的《实用MongoDB聚合》一书中的示例。
The tutorials include examples for each of the official MongoDB drivers. Use the Select your language drop-down menu in the upper-right of each tutorial to set the programming language for the examples.教程包括每个官方MongoDB驱动程序的示例。使用每个教程右上角的“选择语言”下拉菜单为示例设置编程语言。
Each tutorial includes the following sections:每个教程包括以下部分:
About This Task关于此任务: Describes the purpose and common use cases of the aggregation type. This section also describes the example and desired outcome that the tutorial demonstrates.:描述聚合类型的用途和常见用例。本节还介绍了本教程演示的示例和预期结果。Before You Begin开始之前: Provides the template app for each language that explains where to add the aggregation stages. This section also shows sample code to create the necessary databases, collections, and sample data on which you run the aggregation pipeline.:为每种语言提供模板应用程序,解释在哪里添加聚合阶段。本节还显示了创建必要的数据库、集合和示例数据的示例代码,您可以在这些数据库、集合以及示例数据上运行聚合管道。Steps步骤: Walks you through how to build and run the aggregation pipeline. This section describes each stage of the completed aggregation tutorial, and then explains how to run and interpret the output of the aggregation.:引导您了解如何构建和运行聚合管道。本节介绍已完成的聚合教程的每个阶段,然后解释如何运行和解释聚合的输出。
Tutorials教程
This section contains tutorials that demonstrate the following aggregation tasks:本节包含演示以下聚合任务的教程: