apoc.map.fromValues

Details

Syntax

apoc.map.fromValues(values)

Description

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

Arguments

Name

Type

Description

values

LIST<ANY>

A list of keys and values listed pairwise to create a map from.

Returns

MAP

Usage Examples

The following creates a MAP from alternating keys and values in a list:

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