apoc.map.fromPairs

Details

Syntax

apoc.map.fromPairs(pairs)

Description

Creates a MAP from the given LIST<LIST<ANY>> of key-value pairs.

Arguments

Name

Type

Description

pairs

LIST<LIST<ANY>>

A list of pairs to create a map from.

Returns

MAP

Usage Examples

The following creates a MAP from list of key-value pairs:

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