apoc.map.fromLists

Function

apoc.map.fromLists(keys LIST<STRING>, values LIST<ANY>) - creates a MAP from the keys and values in the given LIST<ANY> values.

Signature

apoc.map.fromLists(keys :: LIST<STRING>, values :: LIST<ANY>) :: MAP

Input parameters

Name Type Default

keys

LIST<STRING>

null

values

LIST<ANY>

null

Usage Examples

The following creates a MAP from keys and values lists:

RETURN apoc.map.fromLists(
    ["name", "dob"],
    ["Cristiano Ronaldo", date("1985-02-05")]
) AS output;
Table 1. Results
Output
{
  "name": "Cristiano Ronaldo",
  "dob": "1985-02-05"
}