Skip to content

Commit f83b95a

Browse files
committed
first pass fixes
1 parent 85bc817 commit f83b95a

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

source/write/delete.txt

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ In this guide, you can learn how to use the {+driver-short+} to remove
2424
documents from a MongoDB collection by performing **delete operations**.
2525

2626
A delete operation removes one or more documents from a MongoDB collection.
27-
You can perform a delete operation by using the ``delete_one()`` or
28-
``delete_many()`` methods.
27+
You can perform a delete operation by using the ``deleteOne()`` or
28+
``deleteMany()`` methods.
2929

3030
.. TODO .. tip:: Interactive Lab
3131

@@ -54,6 +54,7 @@ The documents in this collection are modeled by the following {+language+} data
5454
:end-before: end-data-class
5555
:language: kotlin
5656
:copyable:
57+
:dedent:
5758

5859
Delete Operations
5960
-----------------
@@ -80,6 +81,7 @@ document in which the value of the ``name`` field is ``"Happy Garden"``:
8081
:end-before: end-delete-one
8182
:language: kotlin
8283
:copyable:
84+
:dedent:
8385

8486
Delete Multiple Documents
8587
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -93,6 +95,7 @@ value of the ``name`` field is ``"Starbucks"``:
9395
:end-before: end-delete-many
9496
:language: kotlin
9597
:copyable:
98+
:dedent:
9699

97100
Customize the Delete Operation
98101
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -141,17 +144,18 @@ configure a ``DeleteOptions`` instance:
141144
fields </reference/command/delete/#command-fields>` guide in the
142145
{+mdb-server+} manual for more information.
143146

144-
The following code uses the ``deleteMany()`` method to delete all
145-
documents in the ``restaurants`` collection in which the value of the
146-
``name`` field includes the string ``"Red"``. The example also uses the
147-
``comment()`` method to add a comment to the operation and passes the
148-
resulting ``DeleteOptions`` instance to the ``deleteMany()`` method:
147+
The following code creates options and uses the ``comment()`` method to
148+
add a comment to the delete operation. Then, the example uses the
149+
``deleteMany()`` method to delete all documents in the ``restaurants``
150+
collection in which the value of the ``name`` field includes the string
151+
``"Red"``.
149152

150153
.. literalinclude:: /includes/write/delete.kt
151154
:start-after: start-delete-options
152155
:end-before: end-delete-options
153156
:language: kotlin
154157
:copyable:
158+
:dedent:
155159

156160
.. tip::
157161

@@ -170,6 +174,9 @@ a ``DeleteResult`` instance:
170174
- ``wasAcknowledged()``, which returns ``true`` if the server
171175
acknowledges the result
172176

177+
If the query filter does not match any documents, the driver doesn't delete any
178+
documents and the value of ``deletedCount`` is ``0``.
179+
173180
.. note::
174181

175182
If the ``wasAcknowledged()`` method returns ``false``, trying to
@@ -178,17 +185,14 @@ a ``DeleteResult`` instance:
178185
determine these values if the server does not acknowledge the write
179186
operation.
180187

181-
If the query filter does not match any documents, the driver doesn't delete any
182-
documents and ``deletedCount`` is ``0``.
183-
184188
API Documentation
185189
~~~~~~~~~~~~~~~~~
186190

187191
To learn more about any of the methods or types discussed in this
188192
guide, see the following API Documentation:
189193

190194
- `deleteOne() <{+api+}/mongodb-driver-kotlin-sync/com.mongodb.kotlin.client/-mongo-collection/delete-one.html>`__
191-
- `deleteOne() <{+api+}/mongodb-driver-kotlin-sync/com.mongodb.kotlin.client/-mongo-collection/delete-many.html>`__
195+
- `deleteMany() <{+api+}/mongodb-driver-kotlin-sync/com.mongodb.kotlin.client/-mongo-collection/delete-many.html>`__
192196
- `DeleteResult <{+core-api+}/com/mongodb/client/result/DeleteResult.html>`__
193197

194198
.. .. _kotlin-sync-delete-instruqt-lab:

0 commit comments

Comments
 (0)