File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed
includes/fundamentals/code-snippets Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ Connection Guide
1010 Connection Options </connection/connection-options>
1111 MongoClient Settings </connection/mongoclientsettings>
1212 Stable API </connection/stable-api>
13+ Connection Pools </connection/connection-pools>
1314 Network Compression </connection/network-compression>
1415 JNDI Datasource </connection/jndi>
1516 Connection Troubleshooting </connection/connection-troubleshooting>
Original file line number Diff line number Diff line change @@ -52,7 +52,8 @@ string or by passing a ``MongoClientSettings`` object to the
5252``MongoClients.create()`` method.
5353
5454The following code creates a client with a maximum connection pool size of ``50``
55- by using either a connection string or ``MongoClientSettings`` object:
55+ by using either a :guilabel:`Connection String` or :guilabel:`MongoClientSettings`
56+ object:
5657
5758.. tabs::
5859
@@ -61,7 +62,8 @@ by using either a connection string or ``MongoClientSettings`` object:
6162
6263 .. code-block:: java
6364
64- MongoClient mongoClient = MongoClients.create("mongodb://<host>:<port>/?maxPoolSize=50")
65+ ConnectionString connectionString = "mongodb://<host>:<port>/?maxPoolSize=50"
66+ MongoClient mongoClient = MongoClients.create(connectionString)
6567
6668 .. tab:: MongoClientSettings
6769 :tabid: MongoClient
Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ private static void createMongoSettings() {
2020 try {
2121 //begin MongoSettings
2222 MongoClient mongoClient = MongoClients .create (
23- MongoClientSettings .builder ().applyConnectionString (new ConnectionString ("<your connection string>" ))
23+ MongoClientSettings .builder ().applyConnectionString (
24+ new ConnectionString ("<your connection string>" ))
2425 .applyToConnectionPoolSettings (builder ->
2526 builder .maxSize (50 ))
2627 .build ());
You can’t perform that action at this time.
0 commit comments