diff --git a/docs/connections.md b/docs/connections.md index b17bda2bffe..8f9c29ecf7f 100644 --- a/docs/connections.md +++ b/docs/connections.md @@ -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 @@ -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'); diff --git a/docs/queries.md b/docs/queries.md index a87d4916d24..2476a50efa6 100644 --- a/docs/queries.md +++ b/docs/queries.md @@ -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).