Skip to content

Commit 1ede1df

Browse files
committed
Add detail to MONGODB_URI instructions
Also corrected the example connection string, which was in the wrong format
1 parent ddca594 commit 1ede1df

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

README.md

+16-4
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,14 @@ The database comes pre-populated with these user accounts created as part of the
4747
1) [Deploy a MongoDB Atlas free tier cluster](https://docs.atlas.mongodb.com/tutorial/deploy-free-tier-cluster/) (M0 Sandbox)
4848
2) [Enable network access](https://docs.atlas.mongodb.com/security/add-ip-address-to-list/) to the cluster from your current IP address
4949
3) [Add a database user](https://docs.atlas.mongodb.com/tutorial/create-mongodb-user-for-cluster/) to the cluster
50-
4) Set the `MONGODB_URI` environment variable to the connection string of your cluster. Your connection string can be viewed in the cluster's [connect dialog](https://docs.atlas.mongodb.com/tutorial/connect-to-your-cluster/#connect-to-your-atlas-cluster), and will be in the form:
51-
<br>`mongodb+srv://<username>:<password>@<cluster>/<dbname>?retryWrites=true&w=majority`
50+
4) Set the `MONGODB_URI` environment variable to the connection string of your cluster, which can be viewed in the cluster's
51+
[connect dialog](https://docs.atlas.mongodb.com/tutorial/connect-to-your-cluster/#connect-to-your-atlas-cluster). Select "Connect your application",
52+
set the driver to "Node.js" and the version to "2.2.12 or later". This will give a connection string in the form:
53+
```
54+
mongodb://<username>:<password>@<cluster>/<dbname>?ssl=true&replicaSet=<rsname>&authSource=admin&retryWrites=true&w=majority
55+
```
56+
The `<username>` and `<password>` fields need filling in with the details of the database user added earlier. The `<dbname>` field sets the name of the
57+
database nodegoat will use in the cluster (eg "nodegoat"). The other fields will already be filled in with the correct details for your cluster.
5258
5359
6) Populate MongoDB with the seed data required for the app:
5460
```
@@ -116,8 +122,14 @@ This will allow you to fix vulnerabilities in your own forked version, then depl
116122
[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)
117123
118124
In the Create New App dialog, set the `MONGODB_URI` config var to the connection string of your MongoDB Atlas cluster.
119-
Your connection string can be viewed in the cluster's [connect dialog](https://docs.atlas.mongodb.com/tutorial/connect-to-your-cluster/#connect-to-your-atlas-cluster), and will be in the form:
120-
<br>`mongodb+srv://<username>:<password>@<cluster>/<dbname>?retryWrites=true&w=majority`
125+
This can be viewed in the cluster's [connect dialog](https://docs.atlas.mongodb.com/tutorial/connect-to-your-cluster/#connect-to-your-atlas-cluster).
126+
Select "Connect your application", set the driver to "Node.js" and the version to "2.2.12 or later".
127+
This will give a connection string in the form:
128+
```
129+
mongodb://<username>:<password>@<cluster>/<dbname>?ssl=true&replicaSet=<rsname>&authSource=admin&retryWrites=true&w=majority
130+
```
131+
The `<username>` and `<password>` fields need filling in with the details of the database user added earlier. The `<dbname>` field sets the name of the
132+
database nodegoat will use in the cluster (eg "nodegoat"). The other fields will already be filled in with the correct details for your cluster.
121133
122134
123135
## Report bugs, Feedback, Comments

0 commit comments

Comments
 (0)