apoc.map.fromLists

Details

Syntax

apoc.map.fromLists(keys, values)

Description

Creates a MAP from the keys and values in the given LIST<ANY> values.

Arguments

Name

Type

Description

keys

LIST<STRING>

A list of keys to create a map from.

values

LIST<ANY>

A list of values associated with the keys to create a map from.

Returns

MAP

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;
Results
Output
{
  "name": "Cristiano Ronaldo",
  "dob": "1985-02-05"
}