In some case i need to return all data without pagination,
based on issue #219 i can do something like this
app.service('orders').find({paginate: false})
but its only work internally from the server side, not from the client,
may it will be nice if it can work from the client or from querystring like this
http://api.com/orders?$limit=-1
when service.paginate.max = false
or
http://api.com/orders?$paginate=false
By default this is disabled for good reasons (when you have several thousand records disabling pagination can bring down both, the server and the client) but it is possible to map the the query parameter to disable pagination as you suggested with a simple hook:
app.service('myservice').before({
find(hook) {
if(hook.params.query.$limit === '-1') {
hook.params.paginate = false;
delete hook.params.query.$limit;
}
}
});
it works, thanks for youre fast response
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue with a link to this issue for related bugs.
Most helpful comment
By default this is disabled for good reasons (when you have several thousand records disabling pagination can bring down both, the server and the client) but it is possible to map the the query parameter to disable pagination as you suggested with a simple hook: