@@ -18,7 +18,7 @@ Overview
1818In this guide, you can learn how to perform **compound operations**.
1919
2020Compound operations combine a read and write operation into
21- a single operation. If you perform a read and write operation
21+ a single operation. If you perform a read and write operation
2222separately, there's a chance someone else may alter the document between
2323both operations. MongoDB prevents this by placing a write lock on the
2424document you are modifying for the duration of your compound operation.
@@ -44,7 +44,6 @@ Run the following snippet to load the documents into the ``tea.ratings`` collect
4444 :dedent:
4545 :start-after: begin insertDocs
4646 :end-before: end insertDocs
47-
4847.. include:: /includes/fundamentals/tea-sample-data-ending.rst
4948
5049.. _golang-find-and-delete:
@@ -58,10 +57,14 @@ the specified query filter and deletes it. The method returns a
5857
5958.. note::
6059
61- This method differs from the ``DeleteOne()`` method.
62- ``FindOneAndDelete()`` performs a find and delete as a single
63- operation, and eliminates the possibility of someone altering a
64- document between both operations.
60+ The ``FindOneAndDelete()`` method is an atomic operation, which means it prevents
61+ any other write operations from changing the matching document until it
62+ completes. The ``deleteOne()`` method is also an atomic operation, but differs from
63+ ``FindOneAndDelete()`` in that you cannot specify a sort order for the
64+ matched documents.
65+
66+ If you don't need to find and delete a document in a single transaction, you can call
67+ the ``findOne()`` method followed by the ``deleteOne()`` method.
6568
6669Modify Behavior
6770~~~~~~~~~~~~~~~
@@ -141,11 +144,15 @@ document.
141144
142145.. note::
143146
144- This method differs from the ``UpdateOne()`` method.
145- ``FindOneAndUpdate()`` performs a find and update as a single
146- operation, and eliminates the possibility of someone altering a
147- document between both operations.
147+ The ``FindOneAndUpdate()`` method is an atomic operation, which means it prevents
148+ any other write operations from changing the matching document until it
149+ completes. The ``updateOne()`` method is also an atomic operation, but differs from
150+ ``FindOneAndUpdate()`` in that you cannot specify a sort order for the
151+ matched documents.
148152
153+ If you don't need to find and update a document in a single transaction, you can call
154+ the ``findOne()`` method followed by the ``updateOne()`` method.
155+
149156Modify Behavior
150157~~~~~~~~~~~~~~~
151158
0 commit comments