Repository navigation
Keyword array sort
Oliver Atkinson edited this page May 10, 2026
·
1 revision
Sorts an array.
{
"{returns}": {
"array_sort": {
"array": [],
"predicates": [
{
"key_path": ["name"],
"order": "ascending"
}
]
}
}
}-
key_pathis optional. If omitted, the element itself is sorted. -
orderisascendingordescending. - Multiple predicates are applied in order.
- Sorting is stable when predicate values are equal.
{
"{returns}": {
"array_sort": {
"array": [
{ "name": "Scarecrow", "steps_from_emerald_city": 40 },
{ "name": "Dorothy", "steps_from_emerald_city": 12 }
],
"predicates": [
{
"key_path": ["steps_from_emerald_city"],
"order": "descending"
}
]
}
}
}The result is sorted by steps_from_emerald_city descending.