Sort by date (with deep filtering ?)

Hi everyone, I have this kind of data :

{
{
“id”: 23,
“user”: {
“id”: 2,
“username”: “test.test@”,
“email”: “test.test@”,
“provider”: “local”,
“confirmed”: true,
“blocked”: null,
“role”: 5,
“created_at”: “2021-02-17T09:50:24.013Z”,
“updated_at”: “2021-02-21T14:02:43.339Z”,
“Name”: “Test”,
“FirstName”: “Test”,
},
“item”: {
“id”: 521,
“name”: “Bond”,
“model”: “Curry”,
“color”: “#A47656”,
“slug”: “myAwesomeslug”,
“release_date”: “2021-02-19”,
“retail_price”: “110”,
},
{and so on…}
],
},
},

}

I wanted to sort the get response in order to sort all the record with the release_date.
I try to get it with something like :

https://localhost:1337/like?_sort=item.release_date

but I have a 500 response ? How can I sort this ? Thank you :wink:

Hi Squirelle,
comparing your request to the documentation on strapi:
https://strapi.io/documentation/developer-docs/latest/content-api/parameters.html#sort
its seems that the problem is you need to define asc or desc.
So using your sample, it should look like this instead:
https://localhost:1337/users?_sort=item.release_date:asc

1 Like

Hey Ben, Still get a 500 response :sweat:

Bump, sorry I really need this feature :slight_smile: