You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @kvlknctk
Thanks for your suggestion. I just added a mongoose custom plugin that enables pagination.
Have a look at src/services/user.service.js, where I am now using User.paginate(query, options) in the queryUsers function. This is possible through the new custom pagination plugin.
You can of course expand it to include more fields or rename the existing fields by modifying the plugin in src/models/plugins.js .
I will also add some jsdocs explaining how to specify the options.
Hi, thanx for this repo, I have a question. How about paginate. Do you have a bast practice?
I have to set page_number and page count meta.
{ "total": 50, "per_page": 15, "current_page": 1, "last_page": 4, "first_page_url": "http://laravel.app?page=1", "last_page_url": "http://laravel.app?page=4", "next_page_url": "http://laravel.app?page=2", "prev_page_url": null, "path": "http://laravel.app", "from": 1, "to": 15, "data":[ { // Result Object }, { // Result Object } ] }
The text was updated successfully, but these errors were encountered: