apoc.map.merge

Details

Syntax

apoc.map.merge(map1, map2)

Description

Merges the two given MAP values into one MAP.

Arguments

Name

Type

Description

map1

MAP

The first map to merge with the second map.

map2

MAP

The second map to merge with the first map.

Returns

MAP

Usage Examples

The following merges two maps:

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