Skip to content

Commit 82188e6

Browse files
committed
NR PR fixes 1
1 parent 83cc8e6 commit 82188e6

File tree

2 files changed

+21
-22
lines changed

2 files changed

+21
-22
lines changed

docs/fundamentals/write-operations.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -261,14 +261,13 @@ inserting one if it does not exist.
261261
Starting in v4.7, you can perform an upsert operation by using either of
262262
the following methods:
263263

264-
- Use the ``upsert()`` method. When you use this method,
265-
you can perform a **batch upsert** to change or insert multiple documents
266-
in one operation.
264+
- ``upsert()``: When you use this method, you can perform a **batch
265+
upsert** to change or insert multiple documents in one operation.
267266

268-
- Use the ``update()`` method and specify the ``upsert``
269-
option to update all documents that match the query filter or insert
270-
one document if no documents are matched. Only this method is
271-
supported in versions v4.6 and earlier.
267+
- ``update()``: When you use this method, you must specify the
268+
``upsert`` option to update all documents that match the query filter
269+
or insert one document if no documents are matched. Only this upsert method
270+
is supported in versions v4.6 and earlier.
272271

273272
Upsert Method
274273
~~~~~~~~~~~~~
@@ -296,8 +295,9 @@ Example
296295

297296
This example shows how to use the ``upsert()``
298297
method to perform an update or insert in a single operation. Click the
299-
:guilabel:`{+code-output-label+}` button to see the resulting data changes if
300-
there is an ``'Angel Olson'`` document in the collection already:
298+
:guilabel:`{+code-output-label+}` button to see the resulting data changes when
299+
there is a document in which the value of ``performer`` is ``'Angel
300+
Olsen'`` in the collection already:
301301

302302
.. io-code-block::
303303

@@ -330,9 +330,9 @@ there is an ``'Angel Olson'`` document in the collection already:
330330
"updated_at": ...
331331
}
332332

333-
In the ``'Angel Olsen'`` document, the ``venue`` field value is not
334-
changed, as the upsert specifies that the update only applies to the
335-
``ticketsSold`` field.
333+
In the document in which the value of ``performer`` is ``'Angel
334+
Olsen'``, the ``venue`` field value is not updated, as the upsert
335+
specifies that the update applies only to the ``ticketsSold`` field.
336336

337337
Update Method
338338
~~~~~~~~~~~~~

docs/query-builder.txt

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,16 +1036,15 @@ Upsert a Document Example
10361036
~~~~~~~~~~~~~~~~~~~~~~~~~
10371037

10381038
Starting in v4.7, you can perform an upsert operation by using either of
1039-
the following methods:
1039+
the following query builder methods:
10401040

1041-
- Use the ``upsert()`` query builder method. When you use this method,
1042-
you can perform a **batch upsert** to change or insert multiple documents
1043-
in one operation.
1041+
- ``upsert()``: When you use this method, you can perform a **batch
1042+
upsert** to change or insert multiple documents in one operation.
10441043

1045-
- Use the ``update()`` query builder method and specify the ``upsert``
1046-
option to update all documents that match the query filter or insert
1047-
one document if no documents are matched. Only this method is
1048-
supported in versions v4.6 and earlier.
1044+
- ``update()``: When you use this method, you must specify the
1045+
``upsert`` option to update all documents that match the query filter
1046+
or insert one document if no documents are matched. Only this upsert method
1047+
is supported in versions v4.6 and earlier.
10491048

10501049
Upsert Method
10511050
^^^^^^^^^^^^^
@@ -1079,8 +1078,8 @@ to update or insert documents based on the following instructions:
10791078
:start-after: begin upsert
10801079
:end-before: end upsert
10811080

1082-
The ``upsert()`` query builder method returns the sum of the number of documents that the
1083-
operation updated, inserted, and modified.
1081+
The ``upsert()`` query builder method returns the number of
1082+
documents that the operation updated, inserted, and modified.
10841083

10851084
Update Method
10861085
^^^^^^^^^^^^^

0 commit comments

Comments
 (0)