File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 4
4
Connect to MongoDB
5
5
==================
6
6
7
+ .. facet::
8
+ :name: genre
9
+ :values: reference
10
+
11
+ .. meta::
12
+ :keywords: connection string, URI, Atlas, code example
13
+
7
14
In this guide, you can learn how to connect to a
8
15
`MongoDB Atlas deployment <https://www.mongodb.com/docs/atlas>`__,
9
16
a MongoDB instance, or a replica set using the {+driver-short+}.
@@ -178,7 +185,7 @@ class. Select the tab that corresponds to your preferred class.
178
185
179
186
.. code-block:: java
180
187
181
- ConnectionString connectionString = new ConnectionString("mongodb://host1:27017,host2:27017,host3:27017/ ");
188
+ ConnectionString connectionString = new ConnectionString("mongodb://host1:27017,host2:27017,host3:27017");
182
189
MongoClient mongoClient = MongoClients.create(connectionString);
183
190
184
191
.. tab:: MongoClientSettings
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ What's New
19
19
20
20
Learn what's new in:
21
21
22
+ * :ref:`Version 5.2 <version-5.2>`
22
23
* :ref:`Version 5.1.1 <java-version-5.1.1>`
23
24
* :ref:`Version 5.1 <version-5.1>`
24
25
* :ref:`Version 5.0 <version-5.0>`
@@ -37,6 +38,25 @@ Learn what's new in:
37
38
* :ref:`Version 4.1 <version-4.1>`
38
39
* :ref:`Version 4.0 <version-4.0>`
39
40
41
+ .. _version-5.2:
42
+
43
+ What's New in 5.2
44
+ -----------------
45
+
46
+ New features of the 5.2 driver release include:
47
+
48
+ - A forward-slash (``/``) character between the host names and client options in a
49
+ connection URI is optional. The driver parses the following connection URI
50
+ examples in the same way:
51
+
52
+ .. code-block:: java
53
+
54
+ // Connection URI with delimiting forward-slash
55
+ String uri = "mongodb://example.com/?w=majority";
56
+
57
+ // Connection URI without delimiting forward-slash
58
+ String uri = "mongodb://example.com?w=majority";
59
+
40
60
.. _java-version-5.1.1:
41
61
42
62
What's New in 5.1.1
You can’t perform that action at this time.
0 commit comments