op: sort
Sort an array in ascending or descending order.
Allowed phases
| Phase | Status |
|---|---|
preflight | ✗ forbidden |
core | ✓ allowed |
side_effects | ✗ forbidden |
Syntax
- op: sort
path: /items
by: "it.price"
- op: sort
path: /items
by: "-it.price"Parameters
| Field | Required | Description |
|---|---|---|
path | yes | Array field path |
by | yes | Sort key expression; prefix - for descending |
Behavior
- Sort is stable within the runtime implementation for equal keys.
Related operations
See also
- Operations index — all ops by phase
- actions — rule structure and phases
- Intents: Rules — narrative examples