Skip to content

Commit 6d7d2f3

Browse files
DOCSP-40537 Optional delimiting slash in connection string (#557)
1 parent 8d73f97 commit 6d7d2f3

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

source/fundamentals/connection/connect.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
Connect to MongoDB
55
==================
66

7+
.. facet::
8+
:name: genre
9+
:values: reference
10+
11+
.. meta::
12+
:keywords: connection string, URI, Atlas, code example
13+
714
In this guide, you can learn how to connect to a
815
`MongoDB Atlas deployment <https://www.mongodb.com/docs/atlas>`__,
916
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.
178185

179186
.. code-block:: java
180187

181-
ConnectionString connectionString = new ConnectionString("mongodb://host1:27017,host2:27017,host3:27017/");
188+
ConnectionString connectionString = new ConnectionString("mongodb://host1:27017,host2:27017,host3:27017");
182189
MongoClient mongoClient = MongoClients.create(connectionString);
183190

184191
.. tab:: MongoClientSettings

source/whats-new.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ What's New
1919

2020
Learn what's new in:
2121

22+
* :ref:`Version 5.2 <version-5.2>`
2223
* :ref:`Version 5.1.1 <java-version-5.1.1>`
2324
* :ref:`Version 5.1 <version-5.1>`
2425
* :ref:`Version 5.0 <version-5.0>`
@@ -37,6 +38,25 @@ Learn what's new in:
3738
* :ref:`Version 4.1 <version-4.1>`
3839
* :ref:`Version 4.0 <version-4.0>`
3940

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+
4060
.. _java-version-5.1.1:
4161

4262
What's New in 5.1.1

0 commit comments

Comments
 (0)