apoc.map.removeKey

Function

apoc.map.removeKey(map MAP<STRING, ANY>, key STRING, config MAP<STRING, ANY>) - removes the given 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"
}