apoc.map.groupBy
Function
apoc.map.groupBy(values [Any], key String)
- creates a map of the list keyed by the given property, with single values.
Usage Examples
The following creates a map keyed by club
, with a single value
RETURN apoc.map.groupBy([
{name: "Cristiano Ronaldo", club: "Juventus"},
{name: "Lionel Messi", club: "Barcelona"},
{name: "Aaron Ramsey", club: "Juventus"},
{name: "Luiz Suarez", club: "Barcelona"}
], "club") AS output;
Output |
---|
|
Was this page helpful?