@@ -116,6 +116,16 @@ The following example creates an instance of ``UpdateOneModel``:
116116 :copyable:
117117 :dedent:
118118
119+ If multiple documents match the query filter specified in
120+ the ``UpdateOneModel`` instance, the operation updates the first
121+ result. You can specify a sort in an ``UpdateOptions`` instance to apply
122+ an order to matched documents before the driver performs the update
123+ operation, as shown in the following code:
124+
125+ .. code-block:: kotlin
126+
127+ val opts = UpdateOptions().sort(Sorts.ascending(Restaurant::name.name))
128+
119129To update multiple documents, create an instance of ``UpdateManyModel`` and pass
120130the same arguments as for ``UpdateOneModel``. The ``UpdateManyModel``
121131class specifies updates for *all* documents that match your query
@@ -148,8 +158,20 @@ The following example creates an instance of ``ReplaceOneModel``:
148158 :copyable:
149159 :dedent:
150160
151- To replace multiple documents, you must create an instance of
152- ``ReplaceOneModel`` for each document.
161+ If multiple documents match the query filter specified in
162+ the ``ReplaceOneModel`` instance, the operation replaces the first
163+ result. You can specify a sort in a ``ReplaceOptions`` instance to apply
164+ an order to matched documents before the driver performs the replace
165+ operation, as shown in the following code:
166+
167+ .. code-block:: kotlin
168+
169+ val opts = ReplaceOptions().sort(Sorts.ascending(Restaurant::name.name))
170+
171+ .. tip:: Replace Multiple Documents
172+
173+ To replace multiple documents, create an instance of
174+ ``ReplaceOneModel`` for each document.
153175
154176Delete Operations
155177~~~~~~~~~~~~~~~~~
0 commit comments