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 44Connect to MongoDB
55==================
66
7+ .. facet::
8+ :name: genre
9+ :values: reference
10+
11+ .. meta::
12+ :keywords: connection string, URI, Atlas, code example
13+
714In this guide, you can learn how to connect to a
815`MongoDB Atlas deployment <https://www.mongodb.com/docs/atlas>`__,
916a 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
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ What's New
1919
2020Learn 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
4262What's New in 5.1.1
You can’t perform that action at this time.
0 commit comments