Open sofientouati opened 6 years ago
hi I want to sort my response by array size for example like this :
{ "id": 7, "name": "Scimitar", "games": [ 128, 5152, 2438 ] }, { "id": 4, "name": "GoldSrc", "games": [ 231, 6738, 232, 2549, 7551, 8319, 9073, 7589, 241, 55025, 23759, 1335 ] }, { "id": 5, "name": "NeL", "games": [ 6742 ] } }]}
to something like this :
{ "id": 4, "name": "GoldSrc", "games": [ 231, 6738, 232, 2549, 7551, 8319, 9073, 7589, 241, 55025, 23759, 1335 ] }, { "id": 7, "name": "Scimitar", "games": [ 128, 5152, 2438 ] }, { "id": 5, "name": "NeL", "games": [ 6742 ] }]}`
use _sort as follow:
_sort
GET /users?_sort=games.length&_order=desc
/users?_sort=games.length&_order=desc
hi I want to sort my response by array size for example like this :
to something like this :