@@ -54,8 +54,9 @@ Each update method requires the following parameters:
54
54
- **Query filter**, which matches which documents to update. To learn
55
55
more about query filters, see the :ref:`kotlin-sync-specify-query`
56
56
guide.
57
+
57
58
- **Update document**, which specifies the update operator, or the kind of update to
58
- perform, and the fields and values that should change . For a list of update
59
+ perform, and the fields and values to be updated . For a list of update
59
60
operators and their usages, see the :manual:`Field Update Operators
60
61
guide page</reference/operator/update-field/>` in the {+mdb-server+} manual.
61
62
@@ -71,6 +72,7 @@ House"``:
71
72
:end-before: end-update-one
72
73
:language: kotlin
73
74
:copyable:
75
+ :dedent:
74
76
75
77
Update Many Documents
76
78
~~~~~~~~~~~~~~~~~~~~~
@@ -84,6 +86,7 @@ in which the ``name`` value is ``"Starbucks"``. The update renames the
84
86
:end-before: end-update-many
85
87
:language: kotlin
86
88
:copyable:
89
+ :dedent:
87
90
88
91
Customize the Update Operation
89
92
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -124,11 +127,11 @@ configure an ``UpdateOptions`` instance:
124
127
in the {+mdb-server+} manual.
125
128
126
129
* - ``arrayFilters()``
127
- - | Contains a list of filters that specifies which array elements an update applies
128
- to.
130
+ - | Provides a list of filters that you specify to select which
131
+ array elements the update applies to.
129
132
130
133
* - ``hint()``
131
- - | Gets or sets the index to scan for documents.
134
+ - | Sets the index to use when matching documents.
132
135
For more information, see the :manual:`hint statement </reference/command/update/#std-label-update-command-hint>`
133
136
in the {+mdb-server+} manual.
134
137
@@ -150,19 +153,20 @@ Modify Update Example
150
153
`````````````````````
151
154
152
155
The following code uses the ``updateOne()`` method to match documents
153
- in which the ``name`` field has the value ``"Sunrise Pizzeria"``. It then
154
- sets the ``borough`` value in these documents to ``"Queens"`` and the
155
- ``cuisine`` value to ``"Italian"``.
156
+ in which the ``name`` field value is ``"Sunrise Pizzeria"``. It then
157
+ sets the ``borough`` value in the first matching document to
158
+ ``"Queens"`` and the `` cuisine`` value to ``"Italian"``.
156
159
157
160
Because the ``upsert`` option is set to ``true``, the driver inserts a
158
- new document that has the fields and values in the update document if
159
- the query filter doesn't match any existing documents.
161
+ new document that has the fields and values specified in the update
162
+ document if the query filter doesn't match any existing documents.
160
163
161
164
.. literalinclude:: /includes/write/update.kt
162
165
:start-after: start-update-options
163
166
:end-before: end-update-options
164
167
:language: kotlin
165
168
:copyable:
169
+ :dedent:
166
170
167
171
Return Value
168
172
~~~~~~~~~~~~
0 commit comments