apoc.map.removeKey

Function APOC Core

apoc.map.removeKey(map,key,{recursive:true/false}) - remove the key from the map (recursively if recursive is true)

Signature

apoc.map.removeKey(map :: MAP?, key :: STRING?, config = {} :: MAP?) :: (MAP?)

Input parameters

Name Type Default

map

MAP?

null

key

STRING?

null

config

MAP?

{}

Usage Examples

The following removes a key from a map:

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