apoc.coll.sort

Details

Syntax

apoc.coll.sort(coll)

Description

Sorts the given LIST<ANY> into ascending order.

Arguments

Name

Type

Description

coll

LIST<ANY>

The list to be sorted.

Returns

LIST<ANY>

Usage examples

The following sorts a collection:

RETURN apoc.coll.sort([5,4,2,3,1]) AS output;
Results
Output

[1, 2, 3, 4, 5]