Skip to content

Commit

Permalink
fix(total_count_performance): update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinay Padmanabhi committed Sep 18, 2018
1 parent 45fb9e8 commit c124eb8
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,33 @@ server.route({
});
```

### include option - use this option to restrict counting to only the included items in the list

```js
const Book = require('../models/book');

server.route({
method: 'GET',
path: '/books',
config: {
plugins: {
queryFilter: { enabled: true },
totalCount: {
include: ['approximate'],
model: Book
}
},
handler: (request, reply) => {
return new Book().filter(request.query.filter, request.auth.credentials)
.fetchAll()
.then((books) => {
reply({ data: books });
});
}
}
});
```

### Request

```bash
Expand Down

0 comments on commit c124eb8

Please sign in to comment.