apoc.map.removeKey

Details

Syntax

apoc.map.removeKey(map, key [, config ])

Description

Removes the given key from the MAP (recursively if recursive is true).

Arguments

Name

Type

Description

map

MAP

The map to be updated.

key

STRING

The key to remove from the map.

config

MAP

{ recursive = false :: BOOLEAN } The default is: {}.

Returns

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;
Results
Output
{
  "name": "Cristiano Ronaldo",
  "country": "Portugal"
}