diff --git a/source/connect/connection-options.txt b/source/connect/connection-options.txt index 2c6637e1..7a872ee0 100644 --- a/source/connect/connection-options.txt +++ b/source/connect/connection-options.txt @@ -258,8 +258,28 @@ Read and Write Operations time plus this value, the server isn't eligible for selection. | | **Data Type**: `read_preferences <{+api-root+}pymongo/read_preferences.html#pymongo.read_preferences>`__ - | **Default**: ``{+int-data-type+}`` + | **Default**: {+int-data-type+} | **MongoClient Example**: ``localThresholdMS=35`` | **Connection URI Example**: ``localThresholdMS=35`` -For more information about the connection option in this section, see :ref:`pymongo-databases-collections`. + * - **retryReads** + - | Specifies whether the client retries supported read operations. For more + information, see :manual:`Retryable Reads ` in the {+mdb-server+} + manual. + | + | **Data Type**: {+bool-data-type+} + | **Default**: ``True`` + | **MongoClient Example**: ``retryReads=False`` + | **Connection URI Example**: ``retryReads=false`` + + * - **retryWrites** + - | Specifies whether the client retries supported write operations. For more + information, see :manual:`Retryable Writes ` in the {+mdb-server+} + manual. + | + | **Data Type**: {+bool-data-type+} + | **Default**: ``True`` + | **MongoClient Example**: ``retryWrites=False`` + | **Connection URI Example**: ``retryWrites=false`` + +For more information about the connection options in this section, see :ref:`pymongo-databases-collections`. diff --git a/source/databases-collections.txt b/source/databases-collections.txt index 4cdf0a82..1195dd14 100644 --- a/source/databases-collections.txt +++ b/source/databases-collections.txt @@ -283,6 +283,25 @@ within 35 milliseconds of the closest member's ping time. :manual:`localThreshold ` command-line option. +Retryable Reads and Writes +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +{+driver-short+} automatically retries certain read and write operations a single time +if they fail due to a network or server error. + +You can explicitly disable retryable reads or retryable writes by setting the ``retryReads`` or +``retryWrites`` option to ``False`` in the ``MongoClient()`` constructor. The following +example disables retryable reads and writes for a client: + +.. code-block:: python + + client = MongoClient("", + retryReads=False, retryWrites=False) + +To learn more about supported retryable read operations, see :manual:`Retryable Reads ` +in the {+mdb-server+} manual. To learn more about supported retryable write +operations, see :manual:`Retryable Writes ` in the {+mdb-server+} manual. + Troubleshooting ---------------