apoc.map.fromValues

Function

apoc.map.fromValues(values LIST<ANY>) - creates a MAP from the alternating keys and values in the given LIST<ANY>.

Signature

apoc.map.fromValues(values :: LIST<ANY>) :: MAP

Input parameters

Name Type Default

values

LIST<ANY>

null

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