apoc.diff.nodes

Function

Signature

`apoc.diff.nodes (leftNode Node, rightNode Node)` - returns a list detailing the differences between the two given nodes.

Input parameters

Name Type Default

leftNode

NODE?

null

rightNode

NODE?

null

Usage Examples

The examples in this section are based on the following sample graph:

MERGE (joe:Person {name: "Joe", dateOfBirth: datetime("1981-09-02")})
MERGE (ryan:Person {name: "Ryan", twitter: "@ryguyrg"});
MATCH (joe:Person {name: "Joe"})
MATCH (ryan:Person {name: "Ryan"})
RETURN apoc.diff.nodes(joe, ryan) AS output;
Table 1. Results
output

{leftOnly: {dateOfBirth: 1981-09-02T00:00Z}, inCommon: {}, different: {name: {left: "Joe", right: "Ryan"}}, rightOnly: {twitter: "@ryguyrg"}}