apoc.map.fromLists

Function APOC Core

apoc.map.fromLists([keys],[values])

Signature

apoc.map.fromLists(keys :: LIST? OF STRING?, values :: LIST? OF ANY?) :: (MAP?)

Input parameters

Name Type Default

keys

LIST? OF STRING?

null

values

LIST? OF 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",
  "age": "1985-02-05"
}