fix(learn): mongoose set up instructions (#40909)

Co-authored-by: Nicholas Carrigan (he/him) <nhcarrigan@gmail.com>
This commit is contained in:
Tom
2021-02-10 05:34:16 -06:00
committed by GitHub
parent ecde62dda0
commit 959fe8323a

View File

@ -12,7 +12,7 @@ In this challenge, you will import the required projects, and connect to your At
# --instructions--
Add `mongodb` and `mongoose` to the projects `package.json`. Then, require mongoose as `mongoose` in `myApp.js`. Store your MongoDB Atlas database URI in a private `.env` file as `MONGO_URI`. Surround the the URI with single or double quotes, and make sure no space exists between both the variable and the `=`, and the value and `=`. Connect to the database using the following syntax:
Add `mongodb` and `mongoose` to the projects `package.json`. Then, require mongoose as `mongoose` in `myApp.js`. Create a `.env` file and add a `MONGO_URI` variable to it. Its value should be your MongoDB Atlas database URI. Be sure to surround the URI with single or double quotes, and remember that you can't use spaces around the `=` in environment variables. For example, `MONGO_URI='VALUE'`. When you are done, connect to the database using the following syntax:
```js
mongoose.connect(<Your URI>, { useNewUrlParser: true, useUnifiedTopology: true });