Pagination
Paginate
Pagination
data
array [object]
required
limit
integer <uint>
required
>= 1
Default:
100
total
integer <uint>
required
filter is taken into account
>= 0
offset
integer <uint>
required
pages=total/limit
, to get page 3 use offset=total/limit*3
>= 0
Default:
0
limit
, total
and offset
you can create your own pagination system. If for example you want to show the amount of pages, you can use Math.ceil(total / limit)
. To go to a specific page; use limit * (page - 1)
. This will calculate the offset
for the specified page. Page one would return zero; page two would return limit.For example: Someone is adding a resource which should be showing up in page 1, but you are already fetching page 2. Page 1 just became bigger by one, so page 2 will see the last item of page 1 at the top of the list again.
Modified at 2025-01-26 14:07:40