sort
Sort the result with the specified field.
- Javascript
- PHP
- API
const { data, error } = await microgen.service('posts').find({
sort: [{ name: 1 }],
})
$res = $microgen->service('posts')->find([
'sort' => [['name' => 1]]
]);
[GET]
https://database-query.v3.microgen.id/api/v1/API_KEY/posts?$sort[0][name]=1
note
- Ascending = 1
- Descending = -1