fix: updated instructions for install-and-set-up-mongoose (#37908)
Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> Co-authored-by: Kevin Matsuo <kmatsuo@ARDs-MacBook-Pro-2.local>
This commit is contained in:
@ -7,7 +7,7 @@ forumTopicId: 301540
|
||||
|
||||
## Description
|
||||
<section id='description'>
|
||||
Add mongodb and mongoose to the project’s package.json. Then require mongoose. Store your MongoDB Atlas database URI in the private <code>.env</code> file as MONGO_URI. Connect to the database using the following syntax:
|
||||
Add mongodb and mongoose to the project’s package.json. Then require mongoose. Store your MongoDB Atlas database URI in the private <code>.env</code> 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:
|
||||
|
||||
```js
|
||||
mongoose.connect(<Your URI>, { useNewUrlParser: true, useUnifiedTopology: true });
|
||||
|
Reference in New Issue
Block a user