apoc.map.fromValues

Function APOC Core

apoc.map.fromValues([key1,value1,key2,value2,…​])

Signature

apoc.map.fromValues(values :: LIST? OF ANY?) :: (MAP?)

Input parameters

Name Type Default

values

LIST? OF 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"
}