Skip to content

Commit 08e4ab3

Browse files
committed
RUBY-1271 Add retry_writes documentation for a client
1 parent 3f2beb1 commit 08e4ab3

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/tutorials/ruby-driver-create-client.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,12 @@ Ruby Options
407407
- ``Integer``
408408
- none
409409

410+
* - ``:retry_writes``
411+
- If a single-statement write operation fails from a network error, the driver automatically retries it once
412+
when connected to server versions 3.6+.
413+
- ``Boolean``
414+
- false
415+
410416

411417
Details on Timeout Options
412418
--------------------------
@@ -530,3 +536,20 @@ When ``#close`` is called on a client by any thread, all connections are closed:
530536
.. code-block:: ruby
531537

532538
client.close
539+
540+
Details on Retryable Writes
541+
---------------------------
542+
543+
If the ``retry_writes`` option is set to true, the driver will retry single-statement write operations that fail from
544+
a network error. The driver automatically retries the operation once.
545+
546+
Most of the write methods you use day-to-day on a collection will be retryable in 3.6. They are:
547+
548+
- ``collection#insert_one``
549+
- ``collection#update_one``
550+
- ``collection#delete_one``
551+
- ``collection#replace_one``
552+
- ``collection#find_one_and_update``
553+
- ``collection#find_one_and_replace``
554+
- ``collection#find_one_and_delete``
555+
- ``collection#bulk_write`` # as long as there is no ``update_many`` or ``delete_many`` in the list of operations

0 commit comments

Comments
 (0)