apoc.map.fromPairsFunctionDeprecated in Cypher 25
|
This function is deprecated. Use Cypher’s map comprehension instead. |
Syntax |
|
||
Description |
Creates a |
||
Arguments |
Name |
Type |
Description |
|
|
A list of pairs to create a map from. |
|
Returns |
|
||
Usage examples
The following creates a MAP from list of key-value pairs:
apoc.map.fromPairs
RETURN apoc.map.fromPairs([
["name", "Cristiano Ronaldo"],
["age", date("1985-02-05")]
]) AS output;
Cypher’s Map Comprehension
WITH [["name", "Cristiano Ronaldo"], ["age", date("1985-02-05")]] AS pairs
RETURN { pair IN pairs | pair[0]: pair[1] } AS output
| output |
|---|
{
"name": "Cristiano Ronaldo",
"age": "1985-02-05"
}
|