We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 45fb9e8 commit c124eb8Copy full SHA for c124eb8
README.md
@@ -232,6 +232,33 @@ server.route({
232
});
233
```
234
235
+### include option - use this option to restrict counting to only the included items in the list
236
+
237
+```js
238
+const Book = require('../models/book');
239
240
+server.route({
241
+ method: 'GET',
242
+ path: '/books',
243
+ config: {
244
+ plugins: {
245
+ queryFilter: { enabled: true },
246
+ totalCount: {
247
+ include: ['approximate'],
248
+ model: Book
249
+ }
250
+ },
251
+ handler: (request, reply) => {
252
+ return new Book().filter(request.query.filter, request.auth.credentials)
253
+ .fetchAll()
254
+ .then((books) => {
255
+ reply({ data: books });
256
+ });
257
258
259
+});
260
+```
261
262
### Request
263
264
```bash
0 commit comments