@@ -199,8 +199,12 @@ if they fail due to a network or server error.
199
199
200
200
You can explicitly disable retryable reads or retryable writes by setting the ``RetryReads``
201
201
or ``RetryWrites`` options on a ``MongoClientSettings`` object and passing this object to the
202
- ``MongoClient`` constructor. The following example disables retryable reads and writes for
203
- a client:
202
+ ``MongoClient`` constructor. You can also set the ``retryReads`` or ``retryWrites`` options
203
+ in a connection string.
204
+
205
+ The following example disables retryable reads and writes for
206
+ a client. Select the :guilabel:`MongoClientSettings` or :guilabel:`Connection String`
207
+ tab to see the corresponding code.
204
208
205
209
.. literalinclude:: /includes/fundamentals/code-examples/ReplicaSetConfigs.cs
206
210
:start-after: start-retry-reads-writes
@@ -209,6 +213,28 @@ a client:
209
213
:language: csharp
210
214
:dedent:
211
215
216
+ .. tabs::
217
+
218
+ .. tab:: MongoClientSettings
219
+ :tabid: mongoclientsettings
220
+
221
+ .. literalinclude:: /includes/fundamentals/code-examples/ReplicaSetConfigs.cs
222
+ :start-after: start-retry-reads-writes
223
+ :end-before: end-retry-reads-writes
224
+ :emphasize-lines: 2-3
225
+ :language: csharp
226
+ :dedent:
227
+
228
+ .. tab:: Connection String
229
+ :tabid: connectionstring
230
+
231
+ .. literalinclude:: /includes/fundamentals/code-examples/ReplicaSetConfigs.cs
232
+ :start-after: start-retry-reads-writes
233
+ :end-before: end-retry-reads-writes
234
+ :emphasize-lines: 1
235
+ :language: csharp
236
+ :dedent:
237
+
212
238
To learn more about supported retryable read and retryable write operations, see
213
239
:manual:`Retryable Reads </core/retryable-reads/>`
214
240
and :manual:`Retryable Writes </core/retryable-writes/>` in the {+mdb-server+} manual.
0 commit comments