Skip to content

Commit 5dbf738

Browse files
DOCSP-32269 atlas top 250 revamp connection and compat page (#462)
* revamped connection and compat page (cherry picked from commit ed4ba2f)
1 parent 6a730df commit 5dbf738

File tree

5 files changed

+28
-14
lines changed

5 files changed

+28
-14
lines changed

snooty.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ sharedinclude_root = "https://raw.githubusercontent.com/10gen/docs-shared/main/"
1414
[constants]
1515
driver = "java"
1616
driver-long = "MongoDB Java Driver"
17+
driver-short = "Java Driver"
1718
version = "4.5"
1819
full-version = "{+version+}.1"
1920
mdb-server = "MongoDB Server"

source/compatibility.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ Compatibility
2222
:class: singlecol
2323

2424

25+
You can use the {+driver-short+} to connect to deployments hosted in the
26+
following environments:
27+
28+
.. include:: /includes/fact-environments.rst
29+
2530
MongoDB Compatibility
2631
---------------------
2732

source/fundamentals/connection/connect.txt

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
Connect to MongoDB
55
==================
66

7-
In this guide, you can learn how to connect to a MongoDB instance or
8-
replica set using the Java driver.
7+
In this guide, you can learn how to connect to a
8+
`MongoDB Atlas deployment <https://www.mongodb.com/docs/atlas>`__,
9+
a MongoDB instance, or a replica set using the {+driver-short+}.
910

1011
You can view sample code to :ref:`connect to an Atlas cluster <connect-atlas-java-driver>`
1112
or continue reading to learn more about the ``MongoClient`` class and
@@ -50,13 +51,15 @@ connect to a MongoDB deployment. It instructs the driver on how it should
5051
connect to MongoDB and how it should behave while connected. The following
5152
figure explains each part of a sample connection URI:
5253

53-
.. figure:: /includes/figures/connection_uri_parts.png
54-
:alt: Connection String parts figure
54+
.. figure:: /includes/figures/dns_seedlist_connection_string_parts.png
55+
:alt: An example of a connection string that demonstrates the protocol, credentials, hostname or IP, port, and connection options
5556

56-
This figure uses the :manual:`Standard Connection String Format </reference/connection-string/#std-label-connections-standard-connection-string-format>`,
57-
``mongodb`` for the protocol. You can also use the :manual:`DNS Seed List Connection Format </reference/connection-string/#dns-seed-list-connection-format>`,
58-
``mongodb+srv``, if you want more flexibility of deployment and the ability
59-
to change the servers in rotation without reconfiguring clients.
57+
In this example, you connect to an Atlas MongoDB deployment that has a
58+
DNS SRV record. For more details, see the :manual:`DNS Seed List
59+
Connection Format
60+
</reference/connection-string/#dns-seed-list-connection-format>`
61+
documentation. This format offers flexibility in deployment and the
62+
ability to change the servers in rotation without reconfiguring clients.
6063

6164
.. note::
6265

@@ -65,19 +68,24 @@ to change the servers in rotation without reconfiguring clients.
6568
and select Java from the language dropdown to retrieve your connection
6669
string.
6770

68-
The next part of the connection URI contains your credentials if you are
69-
using a password-based authentication mechanism. Replace the value of ``user``
70-
with your username and ``pass`` with your password. If your
71-
authentication mechanism does not require credentials, omit this part of
72-
the connection URI.
71+
If you are connecting to an instance or replica set that does not have a
72+
DNS SRV address, you must use ``mongodb`` for the protocol, which specifies
73+
the :manual:`Standard Connection String Format
74+
</reference/connection-string/#std-label-connections-standard-connection-string-format>`.
75+
76+
After the protocol, the connection string contains your
77+
credentials if you are using a password-based authentication mechanism.
78+
Replace the value of ``user`` with your username and ``pass`` with your
79+
password. If your authentication mechanism does not require credentials,
80+
omit this part of the connection URI.
7381

7482
The next part of the connection URI specifies the hostname or IP
7583
address, followed by the port of your MongoDB instance. In the example,
7684
``sample.host`` represents the hostname and ``27017`` is the port number.
7785
Replace these values to refer to your MongoDB instance.
7886

7987
The last part of the connection URI contains connection options as parameters.
80-
In the example, we set two connection options: ``maxPoolSize=20`` and
88+
In the example, you set two connection options: ``maxPoolSize=20`` and
8189
``w=majority``. For more information on connection options, skip to the
8290
:ref:`connection-options` section of this guide.
8391

-5.92 KB
Binary file not shown.
Loading

0 commit comments

Comments
 (0)