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