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
10
10
Connection Options </connection/connection-options>
11
11
MongoClient Settings </connection/mongoclientsettings>
12
12
Stable API </connection/stable-api>
13
+ Connection Pools </connection/connection-pools>
13
14
Network Compression </connection/network-compression>
14
15
JNDI Datasource </connection/jndi>
15
16
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
52
52
``MongoClients.create()`` method.
53
53
54
54
The 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:
56
57
57
58
.. tabs::
58
59
@@ -61,7 +62,8 @@ by using either a connection string or ``MongoClientSettings`` object:
61
62
62
63
.. code-block:: java
63
64
64
- MongoClient mongoClient = MongoClients.create("mongodb://<host>:<port>/?maxPoolSize=50")
65
+ ConnectionString connectionString = "mongodb://<host>:<port>/?maxPoolSize=50"
66
+ MongoClient mongoClient = MongoClients.create(connectionString)
65
67
66
68
.. tab:: MongoClientSettings
67
69
:tabid: MongoClient
Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ private static void createMongoSettings() {
20
20
try {
21
21
//begin MongoSettings
22
22
MongoClient mongoClient = MongoClients .create (
23
- MongoClientSettings .builder ().applyConnectionString (new ConnectionString ("<your connection string>" ))
23
+ MongoClientSettings .builder ().applyConnectionString (
24
+ new ConnectionString ("<your connection string>" ))
24
25
.applyToConnectionPoolSettings (builder ->
25
26
builder .maxSize (50 ))
26
27
.build ());
You can’t perform that action at this time.
0 commit comments