apoc.map.values

Function APOC Core

apoc.map.values(map, [key1,key2,key3,…​],[addNullsForMissing]) returns list of values indicated by the keys

Signature

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

Input parameters

Name Type Default

map

MAP?

null

keys

LIST? OF 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]