Loopback: Pagination in API loopback

Created on 24 Mar 2016  路  2Comments  路  Source: strongloop/loopback

Loopback auto create API function, but I can't not see pagination of Model with thousand record. Please add this feature.

All 2 comments

You should look into the limit and skip filters.

E.g.

/api/Test?filter[limit]=10&filter[skip]=0
/api/Test?filter[limit]=10&filter[skip]=10
/api/Test?filter[limit]=10&filter[skip]=20

That would be 3 pages, each with 10 records.

There's actually a pagination example on the skip filter documentation page I linked above.

For future refence here's an official blog post.
https://strongloop.com/strongblog/working-with-pagination-and-loopback/

Was this page helpful?
0 / 5 - 0 ratings