System Information
- Strapi Version: 3.53
- Operating System: ubuntu 20.x
- Database: mysql
- Node Version: 14.x
- NPM Version: 6.x
- Yarn Version:
I got a categories collection by query http://localhost/categories?id=6 which return all articles with categories id =6 in the following response. How can I sort by last_post_date in descending order with start and limit parameter for pagination?
for example: fetch all cat id =6, and get 25 per page by last_post_date in descending order.
“id”: 6,
“name”: “sports cat”,
“slug”: “sports-cat”,
“published_at”: “2020-11-10T08:11:34.000Z”,
“created_at”: “2020-11-10T16:11:32.000Z”,
“updated_at”: “2021-01-18T02:16:04.000Z”,
“articles”: [
{
“id”: 1996,
“title”: “articles content”,
“content”: “articles content”,
“published_at”: “2020-12-24T01:49:06.000Z”,
“created_at”: “2020-12-24T01:49:04.000Z”,
“updated_at”: “2020-12-24T01:49:06.000Z”,
“username”: “user”,
“last_post_date”: “2020-09-24T16:00:00.000Z”,
“url”: null,
“img_url”: null,
“category”: null
}