Skip to main content

Behavior

  • by is the field, as a dot path such as score or meta.date. Without by, the items themselves are compared.
  • order is asc (the default) or desc.
  • Numbers compare as numbers and strings as text, so ISO dates sort correctly. The sort is stable.
  • Items missing the field go last in either order.

When to use it

  • Ordering by a value the items already carry: a date, a count, a score from an earlier step.
  • To order items by how well they fit a question, use builtin__rank.

Input

string
Dot path into each item to sort on, e.g. url or meta.date
any[]
required
The list, usually a template like {{E1.results}}
enum<string>
Default ascAvailable options: asc, desc

Output

any[]
required