Skip to content

Commit 9cc1b02

Browse files
author
Chris Cho
committed
edits
1 parent a41cf80 commit 9cc1b02

File tree

4 files changed

+23
-16
lines changed

4 files changed

+23
-16
lines changed

source/includes/quick-start/connect-to-mongodb.rst

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@
44
.. step:: Create your Node.js Application
55

66
Create a file to contain your application called ``index.js`` in your
7-
``node_quickstart`` project directory. Paste the following code into
8-
the file, assigning
9-
the ``uri`` variable the value of your connection string.
10-
7+
``node_quickstart`` project directory.
8+
9+
Copy and paste the following code into the ``index.js`` file:
10+
1111
.. code-block:: js
1212
1313
const { MongoClient } = require("mongodb");
1414
1515
// Replace the uri string with your connection string.
16-
const uri =
17-
"mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority";
16+
const uri = "<connection string uri>";
1817
1918
const client = new MongoClient(uri);
2019
@@ -47,6 +46,13 @@
4746
4847
const MongoClient = require("mongodb").MongoClient;
4948
49+
.. step:: Assign the Connection String
50+
51+
Replace the ``<connection string uri>`` placeholder in
52+
``index.js`` with the connection string that you
53+
copied from the :ref:`quick-start-connection-string` step
54+
in this guide.
55+
5056
.. step:: Run your Node.js Application
5157

5258
Run the application you created from the previous step from the
@@ -73,6 +79,6 @@
7379
proper connection string in the application code, and loaded the sample
7480
data set in your Atlas cluster.
7581

76-
At this point, you should have a working application that uses
77-
the {+driver-short+} to connect to your MongoDB instance, runs a query
78-
on the sample data, and prints out the result.
82+
After completing this step, you should have a working application that
83+
uses the driver to connect to your MongoDB instance, runs a query on
84+
the sample data, and prints out the result.

source/includes/quick-start/create-a-connection-string.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ the {+driver-short+}.
2121

2222
Select the :guilabel:`Password (SCRAM)` authentication mechanism.
2323

24-
Unselect the :guilabel:`Include full driver code example` to view
24+
Deselect the :guilabel:`Include full driver code example` to view
2525
only the connection string.
2626

2727
Click the button on the right of the connection string to copy it to
@@ -30,7 +30,6 @@ your clipboard as shown in the following screenshot:
3030
.. figure:: /includes/figures/atlas_connection_copy_string_node.png
3131
:alt: The connection string copy button in the Atlas UI
3232

33-
3433
Paste this connection string into a a file in your preferred text editor
3534
and replace the "<username>" and "<password>" placeholders with
3635
your database username and password from the previous step.

source/quick-start/create-a-connection-string.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _quick-start-connection-string:
2+
13
==========================
24
Create a Connection String
35
==========================

source/quick-start/overview.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ This guide shows you how to create an application that uses the
1717
you prefer to connect to MongoDB using a different driver or programming
1818
language, see our :driver:`list of official drivers <>`.
1919

20-
The {+driver-short+} is a library you can use to connect to and communicate
21-
with MongoDB.
20+
The {+driver-short+} is a library of functions that you can use to connect
21+
to and communicate with MongoDB.
2222

2323
MongoDB Atlas is a fully managed cloud database service that hosts your
24-
MongoDB servers. You can get started with your own free (no credit card
25-
required) MongoDB instance with this guide.
24+
MongoDB deployments. You can create your own free (no credit card
25+
required) MongoDB Atlas deployment by following the steps in this guide.
2626

2727
Follow the steps in this guide to connect a sample Node.js application to
28-
a MongoDB deployment on MongoDB Atlas.
28+
a MongoDB Atlas deployment.
2929

3030
.. button:: Next: Download and Install
3131
:uri: /quick-start/download-and-install/

0 commit comments

Comments
 (0)