apoc.map.fromListsFunctionDeprecated in Cypher 25
|
This function is deprecated. Use Cypher’s map comprehension instead. |
Syntax |
|
||
Description |
Creates a |
||
Arguments |
Name |
Type |
Description |
|
|
A list of keys to create a map from. |
|
|
|
A list of values associated with the keys to create a map from. |
|
Returns |
|
||
Usage examples
The following creates a MAP from keys and values lists:
apoc.map.fromLists
RETURN apoc.map.fromLists(
["name", "dob"],
["Cristiano Ronaldo", date("1985-02-05")]
) AS output;
Cypher’s Map Comprehension
WITH ["name", "dob"] AS keys,
["Cristiano Ronaldo", date("1985-02-05")] AS values
RETURN { i IN range(0, size(keys) - 1) | keys[i]: values[i] } AS output
| output |
|---|
{
"name": "Cristiano Ronaldo",
"dob": "1985-02-05"
}
|