-
Notifications
You must be signed in to change notification settings - Fork 43
DOCSP-32269 atlas top 250 revamp connection page #458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -4,8 +4,9 @@ | |||||
Connect to MongoDB | ||||||
================== | ||||||
|
||||||
In this guide, you can learn how to connect to a MongoDB instance or | ||||||
replica set using the Java driver. | ||||||
In this guide, you can learn how to connect to a | ||||||
`MongoDB Atlas deployment <https://www.mongodb.com/docs/atlas>`__, | ||||||
a MongoDB instance, or a replica set using the {+driver-short+}. | ||||||
|
||||||
You can view sample code to :ref:`connect to an Atlas cluster <connect-atlas-java-driver>` | ||||||
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 | |||||
connect to MongoDB and how it should behave while connected. The following | ||||||
figure explains each part of a sample connection URI: | ||||||
|
||||||
.. figure:: /includes/figures/connection_uri_parts.png | ||||||
:alt: Connection String parts figure | ||||||
.. figure:: /includes/figures/dns_seedlist_connection_string_parts.png | ||||||
:alt: Each part of the connection string | ||||||
|
||||||
This figure uses the :manual:`Standard Connection String Format </reference/connection-string/#std-label-connections-standard-connection-string-format>`, | ||||||
``mongodb`` for the protocol. You can also use the :manual:`DNS Seed List Connection Format </reference/connection-string/#dns-seed-list-connection-format>`, | ||||||
``mongodb+srv``, if you want more flexibility of deployment and the ability | ||||||
to change the servers in rotation without reconfiguring clients. | ||||||
In this example, we connect to an Atlas MongoDB deployment that has a | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style: Write to the user by using second person. (ref)
Suggested change
|
||||||
DNS SRV record. For more details, see the :manual:`DNS Seed List | ||||||
Connection Format | ||||||
</reference/connection-string/#dns-seed-list-connection-format>` | ||||||
documentation. This format offers flexibility in deployment and the | ||||||
ability to change the servers in rotation without reconfiguring clients. | ||||||
|
||||||
.. note:: | ||||||
|
||||||
|
@@ -65,11 +68,16 @@ to change the servers in rotation without reconfiguring clients. | |||||
and select Java from the language dropdown to retrieve your connection | ||||||
string. | ||||||
|
||||||
The next part of the connection URI contains your credentials if you are | ||||||
using a password-based authentication mechanism. Replace the value of ``user`` | ||||||
with your username and ``pass`` with your password. If your | ||||||
authentication mechanism does not require credentials, omit this part of | ||||||
the connection URI. | ||||||
If you are connecting to an instance or replica set that does not have a | ||||||
DNS SRV address, you must use ``mongodb`` for the protocol, which specifies | ||||||
the :manual:`Standard Connection String Format | ||||||
</reference/connection-string/#std-label-connections-standard-connection-string-format>`. | ||||||
|
||||||
After the protocol, the connection string contains your | ||||||
credentials if you are using a password-based authentication mechanism. | ||||||
Replace the value of ``user`` with your username and ``pass`` with your | ||||||
password. If your authentication mechanism does not require credentials, | ||||||
omit this part of the connection URI. | ||||||
|
||||||
The next part of the connection URI specifies the hostname or IP | ||||||
address, followed by the port of your MongoDB instance. In the example, | ||||||
|
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use better alt text here for accessibility. It should be meaningful to someone who can't see this image. Something like: