@@ -23,19 +23,21 @@ Overview
23
23
In this guide, you can learn about the **builder classes**
24
24
that the {+library-short+} provides to create types used in your
25
25
operations. You can use the builder classes and factory methods from the
26
- :ref:`php-aggregation-builder-api` feature to create filters for other
27
- operations such as find, update, and delete operations.
26
+ Aggregation Builder feature to create filters for other operations such
27
+ as find, update, and delete operations. To learn more about the Aggregation
28
+ Builder, see the :ref:`php-aggregation-builder-api` section of the
29
+ Aggregation guide.
28
30
29
31
Using builders to create queries helps you identify errors at compile
30
32
time and avoid them at runtime. This guide provides information on
31
- builder classes that you can use for the following tasks:
33
+ builder classes that you can use to perform the following tasks:
32
34
33
- - :ref:`Creating a filter definition <php-builders-filter>`
34
- - :ref:`Defining an update operation <php-builders-update>`
35
- - :ref:`Filtering a change stream <php-builders-changestream>`
35
+ - :ref:`php-builders-filter`
36
+ - :ref:`php-builders-update`
37
+ - :ref:`php-builders-changestream`
38
+
39
+ .. note:: Setting Operation Options
36
40
37
- .. note:: Options
38
-
39
41
You cannot specify options by using factory methods for the equivalent
40
42
aggregation stages. For example, you cannot use the ``Stage::limit()`` method
41
43
to set a returned documents limit on your find operation. You must specify
@@ -97,7 +99,7 @@ builders:
97
99
1. Instantiate the ``QueryInterface`` by calling the ``Query::query()``
98
100
method.
99
101
100
- #. Pass the field name to compare and a factory method from the
102
+ #. Pass the field name to filter on and a factory method from the
101
103
``Query`` class. You can pass one or more pairs of field names and
102
104
criteria to the ``QueryInterface``.
103
105
@@ -187,8 +189,8 @@ You can use factory methods from the ``Stage`` builder class to update
187
189
or create field values in your update operations. To learn more about
188
190
updating documents, see the :ref:`php-write-update` guide.
189
191
190
- .. important::
191
-
192
+ .. important:: Only $set Operator Supported
193
+
192
194
The only update operation that you can express by using builders uses
193
195
the ``$set`` operator. This operator allows you to replace the value of
194
196
a field with a specified value or create a new field that has a specified
@@ -218,8 +220,7 @@ This example performs the following actions:
218
220
219
221
- Uses the ``Query::eq()`` factory method to match documents in which
220
222
the ``watlev`` field value is ``'partly submerged at high water'``
221
- - Uses builders to specify an update that sets
222
- sets the ``year`` field to ``1870``
223
+ - Uses the ``Stage::set()`` method to update the ``year`` field to ``1870``
223
224
- Calls the :phpmethod:`MongoDB\Collection::updateOne()`
224
225
method to perform the update
225
226
- Prints the number of updated documents
@@ -280,8 +281,8 @@ This example performs the following actions:
280
281
- Uses the ``Stage::project()`` method to output only the specified change
281
282
event fields
282
283
- Calls the :phpmethod:`MongoDB\Collection::watch()`
283
- method to open the change stream with the option to output the full
284
- document after update
284
+ method to open the change stream and sets the ``fullDocument`` option
285
+ to output the full document after update
285
286
- Prints change events as they occur
286
287
287
288
.. io-code-block::
0 commit comments