Skip to content

Commit

Permalink
(quickstart) remove await for connection, not required as per Automat…
Browse files Browse the repository at this point in the history
  • Loading branch information
lorand-horvath committed Aug 27, 2021
1 parent 7175e02 commit 60b2f1d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,9 @@ connection to the `test` database on our locally running instance of MongoDB.
// getting-started.js
const mongoose = require('mongoose');

main().catch(err => console.log(err));

async function main() {
await mongoose.connect('mongodb://localhost:27017/test');
}
mongoose.connect('mongodb://localhost:27017/test');
```

For brevity, let's assume that all following code is within the `main()` function.

With Mongoose, everything is derived from a [Schema](/docs/guide.html).
Let's get a reference to it and define our kittens.

Expand Down

0 comments on commit 60b2f1d

Please sign in to comment.