apoc.map.values

Function

apoc.map.values(map MAP<STRING, ANY>, keys LIST<STRING>, addNullsForMissing BOOLEAN) - returns a LIST<ANY> indicated by the given keys (returns a null value if a given key is missing).

Signature

apoc.map.values(map :: MAP, keys = [] :: LIST<STRING>, addNullsForMissing = false :: BOOLEAN) :: LIST<ANY>

Input parameters

Name Type Default

map

MAP

null

keys

LIST<STRING>

[]

addNullsForMissing

BOOLEAN

false

Usage Examples

The following returns a list of values for keys name and country, and a null value for missing key missingKey:

WITH {name:"Cristiano Ronaldo",country:"Portugal",dob:date("1985-02-05")} AS map
RETURN apoc.map.values(map, ["name", "country", "missingKey"], true) AS output;
Table 1. Results
Output

["Cristiano Ronaldo","Portugal",null]