-
Notifications
You must be signed in to change notification settings - Fork 3
3.2 Pagination
Lucas Rocha edited this page Feb 8, 2019
·
8 revisions
As described in the usage examples topic, there are two ways to use paging: with skip and with page. The use of page or skip will depend on the use_page configuration used when instantiating the middleware.
Example: Returns the first 20 users.
http://localhost:3000/?skip=0&limit=20
Result:
pagination: {
limit: 20,
skip: 0
}
}
Example: Returns from the 21st to the 40th user.
http://localhost:3000/?skip=20&limit=20
Result:
pagination: {
limit: 20,
skip: 20
}
}
### 2. Pagination With Page
Example: Returns the 20 first users.
http://localhost:3000/?page=1&limit=20
Result:
pagination: {
limit: 20,
page: 1
}
}
Example: Returns from the 21st to the 40th user.
http://localhost:3000/?page=2&limit=20
Result:
pagination: {
limit: 20,
page: 2
}
}