@@ -77,7 +77,7 @@ instance to the constructor. The code configures the following settings:
7777- ``W2`` write concern: The primary replica set member and one secondary member
7878 must acknowledge the write operation.
7979
80- .. literalinclude:: /includes/connect /ReplicaSets.java
80+ .. literalinclude:: /includes/fundamentals/code-snippets /ReplicaSets.java
8181 :language: java
8282 :dedent:
8383 :start-after: start-client-settings
@@ -86,7 +86,7 @@ instance to the constructor. The code configures the following settings:
8686Alternatively, you can specify the read and write settings in the connection
8787URI, which is passed as a parameter to the ``MongoClient`` constructor:
8888
89- .. literalinclude:: /includes/connect /ReplicaSets.java
89+ .. literalinclude:: /includes/fundamentals/code-snippets /ReplicaSets.java
9090 :language: java
9191 :dedent:
9292 :start-after: start-client-settings-uri
@@ -118,7 +118,7 @@ The example configures the following settings:
118118- ``W1`` write concern: The primary replica set member must acknowledge the
119119 write operation.
120120
121- .. literalinclude:: /includes/connect /ReplicaSets.java
121+ .. literalinclude:: /includes/fundamentals/code-snippets /ReplicaSets.java
122122 :language: java
123123 :dedent:
124124 :start-after: start-transaction-settings
@@ -142,7 +142,7 @@ settings:
142142- ``MAJORITY`` write concern: The majority of all replica set members
143143 must acknowledge the write operation.
144144
145- .. literalinclude:: /includes/connect /ReplicaSets.java
145+ .. literalinclude:: /includes/fundamentals/code-snippets /ReplicaSets.java
146146 :language: java
147147 :dedent:
148148 :start-after: start-database-settings
@@ -167,7 +167,7 @@ settings:
167167- ``UNACKNOWLEDGED`` write concern: Replica set members do not need to acknowledge
168168 the write operation.
169169
170- .. literalinclude:: /includes/connect /ReplicaSets.java
170+ .. literalinclude:: /includes/fundamentals/code-snippets /ReplicaSets.java
171171 :language: java
172172 :dedent:
173173 :start-after: start-collection-settings
@@ -208,7 +208,7 @@ preference. The read preference is re-evaluated for each operation.
208208The following example shows how to connect to a sharded cluster and specify a
209209``secondary`` read preference in your connection string:
210210
211- .. literalinclude:: /includes/connect /ReplicaSets.java
211+ .. literalinclude:: /includes/fundamentals/code-snippets /ReplicaSets.java
212212 :language: java
213213 :dedent:
214214 :start-after: start-sharded-cluster-uri
@@ -260,7 +260,7 @@ set members to the ``ReadPreference.secondary()`` setter method. Then, the code
260260passes the read preference information to the ``withReadPreference()`` method
261261to set the read order on the database:
262262
263- .. literalinclude:: /includes/connect /ReplicaSets.java
263+ .. literalinclude:: /includes/fundamentals/code-snippets /ReplicaSets.java
264264 :language: java
265265 :dedent:
266266 :start-after: start-tag-set
@@ -289,7 +289,7 @@ corresponding code for each approach:
289289 .. tab:: MongoClientSettings
290290 :tabid: settings
291291
292- .. literalinclude:: /includes/connect /ReplicaSets.java
292+ .. literalinclude:: /includes/fundamentals/code-snippets /ReplicaSets.java
293293 :language: rust
294294 :dedent:
295295 :start-after: start-local-threshold-settings
@@ -299,7 +299,7 @@ corresponding code for each approach:
299299 .. tab:: Connection URI
300300 :tabid: uri
301301
302- .. literalinclude:: /includes/connect /ReplicaSets.java
302+ .. literalinclude:: /includes/fundamentals/code-snippets /ReplicaSets.java
303303 :language: rust
304304 :dedent:
305305 :start-after: start-local-threshold-uri
0 commit comments