Skip to content

Commit

Permalink
Fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rachaelshaw committed Nov 25, 2020
1 parent 00578a2 commit 5130efd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions sails-docs/tutorials/mongo.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,14 @@ As of `sails-mongo` v2.0.0 and above, you can access the [`MongoClient`](https:/
and with it, transactions, [change streams](https://mongodb.github.io/node-mongodb-native/3.5/api/ChangeStream.html), and other new features.

```js
var mongoClient = Pet.getDatastore().manager.client;
var mongoClient = Pet.getDatastore().manager.client;
var results = await mongoClient.db('test')
.collection('pet')
.find({}, { name: 1 })
.toArray();
var results = await mongoClient.db('test')
.collection('pet')
.find({}, { name: 1 })
.toArray();
console.log(results);
```

For a full list of methods available in the native MongoDB client, see the [Node.js MongoDB Driver API reference](https://mongodb.github.io/node-mongodb-native/3.5/api/Collection.html).
Expand Down

0 comments on commit 5130efd

Please sign in to comment.