@@ -49,7 +49,7 @@ Aggregation operations have some :manual:`limitations </core/aggregation-pipelin
4949 of 16 megabytes.
5050
5151- Pipeline stages have a memory limit of 100 megabytes by default. If required, you may exceed this limit by using
52- the `allowDiskUse <https://mongodb.github.io/mongo-java-driver/4.2/ apidocs/mongodb-driver-sync/com/mongodb/client/AggregateIterable.html#allowDiskUse(java.lang.Boolean)>`__
52+ the :java-docs: `allowDiskUse <apidocs/mongodb-driver-sync/com/mongodb/client/AggregateIterable.html#allowDiskUse(java.lang.Boolean)>`
5353 method.
5454
5555 .. important:: ``$graphLookup`` exception
@@ -116,20 +116,17 @@ Basic Aggregation Example
116116~~~~~~~~~~~~~~~~~~~~~~~~~
117117
118118To perform an aggregation, pass a list of aggregation stages to the
119- :java-docs:`MongoCollection.aggregate() <apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#aggregate(java.util.List)>`
120- method.
119+ ``MongoCollection.aggregate()`` method.
121120
122121The Java driver provides the
123122:java-docs:`Aggregates <apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html>`
124- helper class that
125- contains builders for aggregation stages.
123+ helper class that contains builders for aggregation stages.
126124
127125In the following example, the aggregation pipeline:
128126
129127- Uses a :manual:`$match </reference/operator/aggregation/match/>` stage to filter for documents whose
130128 ``categories`` array field contains the element ``Bakery``. The example uses
131- :java-docs:`Aggregates.match <apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html#match(org.bson.conversions.Bson)>`
132- to build the ``$match`` stage.
129+ ``Aggregates.match`` to build the ``$match`` stage.
133130
134131- Uses a :manual:`$group </reference/operator/aggregation/group/>` stage to group the matching documents by the ``stars``
135132 field, accumulating a count of documents for each distinct value of ``stars``.
@@ -152,6 +149,12 @@ The above aggregation should produce the following results:
152149 {"_id": 4, "count": 2}
153150 {"_id": 5, "count": 1}
154151
152+ For more information about the methods and classes mentioned in this section,
153+ see the following API Documentation:
154+
155+ - :java-docs:`MongoCollection.aggregate() <apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#aggregate(java.util.List)>`
156+ - :java-docs:`Aggregates.match <apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html#match(org.bson.conversions.Bson)>`
157+
155158Explain Aggregation Example
156159~~~~~~~~~~~~~~~~~~~~~~~~~~~
157160
@@ -191,18 +194,16 @@ following resources:
191194
192195- :manual:`Explain Output </reference/explain-results/>` Server Manual Entry
193196- :manual:`Query Plans </core/query-plans/>` Server Manual Entry
194- - :java-core-api :`ExplainVerbosity <com/mongodb/ExplainVerbosity>` API Documentation
197+ - :java-docs :`ExplainVerbosity <apidocs/mongodb-driver-core/ com/mongodb/ExplainVerbosity>` API Documentation
195198- :java-docs:`explain() <apidocs/mongodb-driver-sync/com/mongodb/client/FindIterable.html#explain()>` API Documentation
196199- :java-docs:`AggregateIterable <apidocs/mongodb-driver-sync/com/mongodb/client/AggregateIterable.html>` API Documentation
197200
198201Aggregation Expression Example
199202~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
200203
201- The Java driver provides builders for
202- :java-docs:`accumulator expressions <apidocs/mongodb-driver-core/com/mongodb/client/model/Accumulators.html>`
203- for use with
204- :java-docs:`$group <apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html#group(TExpression,java.util.List)>`. You
205- must declare all other expressions in JSON format or compatible document format.
204+ The Java driver provides builders for accumulator expressions for use with
205+ ``$group``. You must declare all other expressions in JSON format or
206+ compatible document format.
206207
207208.. tip::
208209
@@ -223,19 +224,16 @@ must declare all other expressions in JSON format or compatible document format.
223224 Document.parse("{ $arrayElemAt: ['$categories', 0] }")
224225
225226In the following example, the aggregation pipeline uses a
226- `$project <https://mongodb.github.io/mongo-java-driver/4.2/apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html#project(org.bson.conversions.Bson)>`__
227- stage and various
228- `Projections <https://mongodb.github.io/mongo-java-driver/4.2/apidocs/mongodb-driver-core/com/mongodb/client/model/Projections.html>`__
229- to return the ``name`` field and the calculated field ``firstCategory`` whose value is the first element in the
230- ``categories`` field.
227+ ``$project`` stage and various ``Projections`` to return the ``name``
228+ field and the calculated field ``firstCategory`` whose value is the
229+ first element in the ``categories`` field.
231230
232231.. literalinclude:: /includes/fundamentals/code-snippets/AggTour.java
233232 :language: java
234233 :dedent:
235234 :start-after: begin aggregation two
236235 :end-before: end aggregation two
237236
238-
239237The above aggregation should produce the following results:
240238
241239.. code-block:: none
@@ -251,3 +249,11 @@ The above aggregation should produce the following results:
251249 {"name": "ZZZ Pasta Buffet", "firstCategory": "Pasta"}
252250 {"name": "XYZ Coffee Bar", "firstCategory": "Coffee"}
253251 {"name": "XYZ Bagels Restaurant", "firstCategory": "Bagels"}
252+
253+ For more information about the methods and classes mentioned in this section,
254+ see the following API Documentation:
255+
256+ - :java-docs:`Accumulators <apidocs/mongodb-driver-core/com/mongodb/client/model/Accumulators.html>`
257+ - :java-docs:`$group <apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html#group(TExpression,java.util.List)>`
258+ - :java-docs:`$project <apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html#project(org.bson.conversions.Bson)>`
259+ - :java-docs:`Projections <apidocs/mongodb-driver-core/com/mongodb/client/model/Projections.html>`
0 commit comments