apoc.coll.sortMaps
Syntax |
|
||
Description |
Sorts the given |
||
Arguments |
Name |
Type |
Description |
|
|
The list of maps to be sorted. |
|
|
|
The property key to be used to sort the list of maps by. |
|
Returns |
|
Usage examples
The following sorts a list of maps in reverse alphabetical order by the key name
:
RETURN apoc.coll.sortMaps([
{name: "Lionel Messi"},
{name: "Cristiano Ronaldo"},
{name: "Wayne Rooney"}
], "name") AS output;
Output |
---|
|
The following sorts a list of maps in alphabetical order by the key name
:
RETURN apoc.coll.sortMaps([
{name: "Lionel Messi"},
{name: "Cristiano Ronaldo"},
{name: "Wayne Rooney"}
], "^name") AS output;
Output |
---|
|