Skip to content

Commit

Permalink
made requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
IslandRhythms committed May 24, 2023
1 parent 3f53fac commit 45a2c29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docs/connections.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ Mongoose lets you start using your models immediately, without waiting for
mongoose to establish a connection to MongoDB.

```javascript
await mongoose.connect('mongodb://127.0.0.1:27017/myapp');
mongoose.connect('mongodb://127.0.0.1:27017/myapp');
const MyModel = mongoose.model('Test', new Schema({ name: String }));
// Works
await MyModel.findOne();
MyModel.findOne();
```

That's because mongoose buffers model function calls internally. This
Expand All @@ -53,7 +53,7 @@ connecting.
```javascript
const MyModel = mongoose.model('Test', new Schema({ name: String }));
// Will just hang until mongoose successfully connects
await MyModel.findOne();
MyModel.findOne();

setTimeout(function() {
mongoose.connect('mongodb://127.0.0.1:27017/myapp');
Expand Down
2 changes: 1 addition & 1 deletion docs/queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ await Person.
exec();

// Using query builder
Person.
await Person.
find({ occupation: /host/ }).
where('name.last').equals('Ghost').
where('age').gt(17).lt(66).
Expand Down

0 comments on commit 45a2c29

Please # to comment.