Skip to content

Commit 70bcf6c

Browse files
committed
LM PR fixes 1
1 parent ce272b3 commit 70bcf6c

File tree

5 files changed

+38
-35
lines changed

5 files changed

+38
-35
lines changed

source/aggregation.txt

+30-27
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Consider the following limitations when performing aggregation operations:
7272
- Returned documents cannot violate the
7373
:manual:`BSON document size limit </reference/limits/#mongodb-limit-BSON-Document-Size>`
7474
of 16 megabytes.
75+
7576
- Pipeline stages have a memory limit of 100 megabytes by default. You can exceed this
7677
limit by creating an options array that sets the ``allowDiskUse`` option to ``true``
7778
and passing the array to the ``MongoDB\Collection::aggregate()`` method.
@@ -89,9 +90,9 @@ The {+library-short+} provides the following APIs to create aggregation
8990
pipelines:
9091

9192
- :ref:`php-aggregation-array-api`: Create aggregation pipelines by
92-
passing arrays that specify the aggregation operators and parameters
93+
passing arrays that specify the aggregation operators and parameters.
9394
- :ref:`php-aggregation-builder-api`: Create aggregation pipelines by using native
94-
classes and methods to make your application more type-safe and debuggable
95+
classes and methods to make your application more type-safe and debuggable.
9596

9697
The following sections describe each API and provide examples for
9798
creating aggregation pipelines.
@@ -126,12 +127,12 @@ Filter and Group Example
126127
The following code example produces a count of the number of bakeries in each borough
127128
of New York. To do so, it uses an aggregation pipeline that contains the following stages:
128129

129-
- :manual:`$match </reference/operator/aggregation/match/>` stage to filter for documents
130-
in which the ``cuisine`` field contains the value ``'Bakery'``
130+
1. :manual:`$match </reference/operator/aggregation/match/>` stage to filter for documents
131+
in which the ``cuisine`` field contains the value ``'Bakery'``
131132

132-
- :manual:`$group </reference/operator/aggregation/group/>` stage to group the matching
133-
documents by the ``borough`` field, accumulating a count of documents for each distinct
134-
value
133+
#. :manual:`$group </reference/operator/aggregation/group/>` stage to group the matching
134+
documents by the ``borough`` field, accumulating a count of documents for each distinct
135+
value
135136

136137
.. io-code-block::
137138
:copyable:
@@ -195,14 +196,16 @@ Aggregation Builder
195196
To create an aggregation pipeline by using the Aggregation Builder,
196197
perform the following actions:
197198

198-
#. Create an array to store the pipeline stages
199+
1. Create an array to store the pipeline stages.
199200

200-
#. For each stage, call an operator method from the ``Stage``
201-
builder class to create that type of aggregation stage
201+
#. For each stage, call the an operator method from the
202+
``Stage`` that shares the same name as your desired aggregation
203+
stage. For example, to create an ``$unwind`` stage, call the
204+
``Stage::unwind()`` method.
202205

203206
#. Within the body of the ``Stage`` method, use methods from other
204207
builder classes such as ``Query``, ``Expression``, or ``Accumulator``
205-
to express your aggregation specifications
208+
to express your aggregation specifications.
206209

207210
The following code demonstrates the template for constructing
208211
aggregation pipelines:
@@ -236,17 +239,17 @@ The following code example calculates the total sales amount, average
236239
sales quantity, and sale count for each day in the year 2014. To do so,
237240
it uses an aggregation pipeline that contains the following stages:
238241

239-
- :manual:`$match </reference/operator/aggregation/match/>` stage to
240-
filter for documents that contain a ``date`` field in which the year is
241-
2014
242+
1. :manual:`$match </reference/operator/aggregation/match/>` stage to
243+
filter for documents that contain a ``date`` field in which the year is
244+
2014
242245

243-
- :manual:`$group </reference/operator/aggregation/group/>` stage to
244-
group the documents by date and calculate the total sale amount,
245-
average quantity, and total count for each group
246+
#. :manual:`$group </reference/operator/aggregation/group/>` stage to
247+
group the documents by date and calculate the total sale amount,
248+
average quantity, and total count for each group
246249

247-
- :manual:`$sort </reference/operator/aggregation/sort/>` stage to
248-
sort the results by the total sale amount for each group in descending
249-
order
250+
#. :manual:`$sort </reference/operator/aggregation/sort/>` stage to
251+
sort the results by the total sale amount for each group in descending
252+
order
250253

251254
.. io-code-block::
252255
:copyable:
@@ -275,15 +278,15 @@ The following code example groups sold items by their tags and
275278
calculates the total sales amount for each tag. To do so,
276279
it uses an aggregation pipeline that contains the following stages:
277280

278-
- :manual:`$unwind </reference/operator/aggregation/unwind/>` stage to
279-
output a separate document for each element in the ``items`` array
281+
1. :manual:`$unwind </reference/operator/aggregation/unwind/>` stage to
282+
output a separate document for each element in the ``items`` array
280283

281-
- :manual:`$unwind </reference/operator/aggregation/unwind/>` stage to
282-
output a separate document for each element in the ``items.tags`` arrays
284+
#. :manual:`$unwind </reference/operator/aggregation/unwind/>` stage to
285+
output a separate document for each element in the ``items.tags`` arrays
283286

284-
- :manual:`$group </reference/operator/aggregation/group/>` stage to
285-
group the documents by the tag value and calculates the total sales
286-
amount of items that have each tag
287+
#. :manual:`$group </reference/operator/aggregation/group/>` stage to
288+
group the documents by the tag value and calculates the total sales
289+
amount of items that have each tag
287290

288291
.. io-code-block::
289292
:copyable:

source/aggregation/atlas-search.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ Search queries by using the Aggregation Builder:
6666
To create a ``$search`` stage in your aggregation pipeline, perform the
6767
following actions:
6868

69-
1. Create an array to store the pipeline stages
69+
1. Create an array to store the pipeline stages.
7070

71-
#. Call the ``Stage::search()`` method to create the Atlas Search stage
71+
#. Call the ``Stage::search()`` method to create the Atlas Search stage.
7272

7373
#. Within the body of the ``search()`` method, use methods from the
74-
``Search`` builder class to construct your Search query criteria
74+
``Search`` builder class to construct your Search query criteria.
7575

7676
The following code demonstrates the template for constructing basic Atlas Search
7777
queries:

source/aggregation/vector-search.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ Search queries by using the Aggregation Builder:
6767
To create a ``$vectorSearch`` stage in your aggregation pipeline, perform the
6868
following actions:
6969

70-
1. Create an array to store the pipeline stages
70+
1. Create an array to store the pipeline stages.
7171

7272
#. Call the ``Stage::vectorSearch()`` method to create the Atlas Vector
73-
Search stage
73+
Search stage.
7474

7575
#. Within the body of the ``vectorSearch()`` method, specify the
76-
criteria for your vector query
76+
criteria for your vector query.
7777

7878
The following code demonstrates the template for constructing basic Atlas Search
7979
queries:

source/includes/aggregation/aggregation.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
),
112112
];
113113

114-
/* Perform the aggregation on the orders collection */
114+
/* Performs the aggregation on the orders collection */
115115
$cursor = $collection->aggregate($pipeline);
116116

117117
foreach ($cursor as $doc) {

source/whats-new.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ What's New in 1.21
3838
The {+library-short+} v1.21 release includes the following features,
3939
improvements, and fixes:
4040

41-
- Introduces the Aggregation Builder as an API to build aggregation
41+
- Introduces the Aggregation Builder, an API to build aggregation
4242
pipelines in a more type-safe and PHP-native way. To learn more and
4343
view examples, see the :ref:`php-aggregation-builder-api` section of
4444
the Aggregation guide.

0 commit comments

Comments
 (0)