apoc.map.sortedProperties
Function APOC Core
apoc.map.sortedProperties(map, ignoreCase:true) - returns a list of key/value list pairs, with pairs sorted by keys alphabetically, with optional case sensitivity
Usage Examples
The following returns a list of key/value list pairs with pairs sorted by key alphabetically:
WITH {name:"Cristiano Ronaldo",country:"Portugal",dob:date("1985-02-05")} AS map
RETURN apoc.map.sortedProperties(map) AS output;
Output |
---|
[["country","Portugal"],["dob","1985-02-05"],["name","Cristiano Ronaldo"]] |