Collection/Order

◷ Reading Time: 2 minutes

orderAsc

Sorts the elements of a sequence in ascending order.

orderDesc

Sorts the elements of a sequence in descending order.

orderByAsc

Sorts the elements of a sequence in ascending order.

orderByDesc

Sorts the elements of a sequence in descending order.

orderBy

Sorts the elements of a sequence in ascending order according to a key.

|orderBy (localName, predicate1, predicate2, ... )
predicate: expression asc 
predicate: expression desc
predicate: expression

Predicate is an expression to access members using the local parameters ending with asc or desc. The default order is asc, unless specified.

IDNameFamily
3ClarkKent
2PeterParker
4TonyStark
5HelenaWayne
1BruceWayne
Example: 
list|orderBy (x,x.Family desc, x.Name)

orderByList

Sorts the elements of a sequence in reference to a list.

 |orderByList (localName, predicate, list)

Predicate is an expression to access members using the local parameters.

IDNameFamily
3ClarkKent
2PeterParker
4TonyStark
5HelenaWayne
1BruceWayne
Example: list |orderByList(x, x.Family, ['Wayne', 'Strak', 'Kent', 'Parker'])
Updated on July 31, 2019

Was this article helpful?

Related Articles