Pagination and Sorting
The LIST endpoints of the NOÉ API support sorting and pagination parameters to efficiently manage large collections of entities.
📋 Main Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
sort | Sorting instructions separated by commas | Define the order of the results | sort=-createdAt,+name |
limit | Number | Maximum number of results returned | limit=10 |
skip | Number | Offset of the results for pagination | skip=20 |
🔧 Parameter Details
Sort
Allows sorting results by one or more fields.
- Prefix
+→ ascending order - Prefix
-→ descending order - Multiple fields: separate with a comma
,
# Sort by creation date ascending, then by name descending
GET /projects/:projectId/activities?sort=+createdAt,-name
Limit
Limits the number of documents returned by the request. Helps control server load and implement pagination.
# Returns the first 10 results
GET /projects/:projectId/activities?limit=10
Skip
Allows skipping a number of results to implement pagination. Often used in combination with limit.
# Returns 10 results starting from the 21st result
GET /projects/:projectId/activities?limit=10&skip=20
📦 Combination with Filters
All pagination and sorting parameters can be combined with filters defined via filter:
GET /projects/:projectId/activities?
filter[tags][$in]=musique,art
&sort=+createdAt,-name
&limit=10
&skip=20
- Filter: activities with the tags "musique" or "art"
- Sort: first by creation date ascending, then by name descending
- Pagination: page 3 (items 21 to 30)