Skip to content

Commit 4e591ed

Browse files
committed
code edits
1 parent bf85faa commit 4e591ed

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/includes/fundamentals/code-snippets/ReplicaSets.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
public class ReplicaSets {
2020

21-
public static void main(String[] args) throws InterruptedException {
21+
public static void main(String[] args) {
2222

2323
// Uses the settings builder methods to set read and write settings for the client
2424
// start-client-settings
@@ -81,7 +81,7 @@ public static void main(String[] args) throws InterruptedException {
8181

8282
ReadPreference readPref= ReadPreference.secondary(Arrays.asList(tag1, tag2, tag3));
8383

84-
database = mongoClient.getDatabase("test_database")
84+
MongoDatabase database = mongoClient.getDatabase("test_database")
8585
.withReadPreference(readPref);
8686
// end-tag-set
8787

@@ -95,7 +95,7 @@ public static void main(String[] args) throws InterruptedException {
9595
// Instructs the library to distribute reads between members within 35 milliseconds
9696
// of the closest member's ping time using a URI option
9797
// start-local-threshold-settings
98-
MongoClient timedClient = MongoClients.create(MongoClientSettings.builder()
98+
MongoClient client = MongoClients.create(MongoClientSettings.builder()
9999
.applyConnectionString(new ConnectionString("mongodb://localhost:27017/"))
100100
.applyToClusterSettings(builder -> builder.localThreshold(35, TimeUnit.MILLISECONDS))
101101
.build());

0 commit comments

Comments
 (0)