apoc.convert.toSortedJsonMap
Syntax |
|
||
Description |
Converts a serialized JSON object from the property of a given |
||
Arguments |
Name |
Type |
Description |
|
|
The value to convert into a stringified JSON map. |
|
|
|
Whether or not to ignore the case of the keys when sorting. The default is: |
|
Returns |
|
Usage examples
The following converts a map to a JSON map with keys sorted alphabetically, ignoring case sensitivity:
WITH {b:8, d:3, a:2, E: 12, C:9} as map
RETURN apoc.convert.toSortedJsonMap(map) as output;
Output |
---|
"{\"a\":2,\"b\":8,\"C\":9,\"d\":3,\"E\":12}" |
The following converts a map to a JSON map with keys sorted alphabetically, with case sensitivity:
WITH {b:8, d:3, a:2, E: 12, C:9} as map
RETURN apoc.convert.toSortedJsonMap(map, false) as output;
Output |
---|
"{\"C\":9,\"E\":12,\"a\":2,\"b\":8,\"d\":3}" |