apoc.map.fromLists

Function

apoc.map.fromLists(keys [String], values [Any]) - creates a map from the keys and values in the given list.

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",
  "dob": "1985-02-05"
}