diff --git a/source/crud/update.txt b/source/crud/update.txt index e766bfa4..2ba6b0b4 100644 --- a/source/crud/update.txt +++ b/source/crud/update.txt @@ -105,6 +105,19 @@ where the value of the ``name`` field is ``"Starbucks"``. The update document us 11 document(s) updated +Upsert Option +~~~~~~~~~~~~~ + +The ``upsert`` parameter allows you to use the ``update_one()`` and +``update_many()`` operations to perform a conditional operation: + +- If the specified document exists, the command updates it. +- If the specified document does not exist, the command creates a new document + with the specified parameter. + +For more information, see the :ref:`` section or the :ref:`options +table ` on this page. + Customize the Update Operation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -117,6 +130,8 @@ operation with default settings. The following table describes the options that you can use to configure the update operation: +.. _ruby-update-options-table: + .. list-table:: :widths: 30 70 :header-rows: 1 @@ -161,6 +176,8 @@ configure the update operation: ` in the {+mdb-server+} manual. +.. _ruby-upsert-example: + Modify Update Example `````````````````````