-
Notifications
You must be signed in to change notification settings - Fork 29
DOCSP-42735: configure cxn #49
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,52 @@ | ||||||
.. _mongoid-quick-start-sinatra-connect-to-mongodb: | ||||||
|
||||||
================================= | ||||||
Configure Your MongoDB Connection | ||||||
================================= | ||||||
|
||||||
.. facet:: | ||||||
:name: genre | ||||||
:values: tutorial | ||||||
|
||||||
.. meta:: | ||||||
:keywords: test connection, runnable, code example | ||||||
|
||||||
.. procedure:: | ||||||
:style: connected | ||||||
|
||||||
.. step:: Specify target database in connection string | ||||||
|
||||||
When connecting to an Atlas cluster, you must specify the database that | ||||||
you want to interact with as the default database in your connection string. | ||||||
You must add the database name to your connection string **after the hostname**. | ||||||
|
||||||
We want to access the ``sample_restaurants`` database for this tutorial. | ||||||
For example, if the connection string for your Atlas cluster is | ||||||
``"mongodb+srv://user0:[email protected]/"``, you can | ||||||
specify the target database as shown in the following code: | ||||||
|
||||||
.. code-block:: none | ||||||
|
||||||
mongodb+srv://user0:[email protected]/sample_restaurants | ||||||
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.
Suggested change
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. I'll leave the connection string as is an specify that its a sample |
||||||
|
||||||
.. step:: Specify connection | ||||||
|
||||||
In your project, create the ``config`` directory, then create a | ||||||
file in this directory called ``mongoid.yml``. | ||||||
|
||||||
Paste the following configuration into the file, making sure to | ||||||
|
Paste the following configuration into the file, making sure to | |
Paste the following configuration into the ``mongoid.yml`` file, making sure to |
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.
I think this can be modified to just introduce the code example to avoid using "we" and to make it more closely mirror our other repos.