apoc.map.merge

Function APOC Core

apoc.map.merge(first,second) - merges two maps

Signature

apoc.map.merge(first :: MAP?, second :: MAP?) :: (MAP?)

Input parameters

Name Type Default

first

MAP?

null

second

MAP?

null

Usage Examples

The following merges two maps:

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