I'm trying to figure out what is the difference between MERGE and CREATE UNIQUE. I know these features:
MERGE
I'm able to create node, if doesn't exist pattern.
MERGE (n { name:"X" }) RETURN n;
This create node "n" with property name, empty node "m" and relationship RELATED.
MERGE (n { name:"X" })-[:RELATED]->(m) RETURN n, m;
CREATE UNIQUE
I'm not able to create node like this.
CREATE UNIQUE (n { name:"X" }) RETURN n;
If exists node "n", create unique makes empty node "m" and relationship RELATED.
MATCH (n { name: 'X' }) CREATE UNIQUE (n)-[:RELATED]->(m) RETURN n, m;
If this pattern exists, nothing created, only returns pattern.
From my point of view, I see MERGE and CREATE UNIQUE are quite same queries, but with CREATE UNIQUE you can't create start node in relationship. I would be grateful, if someone could explain this issue and compare these queries, thx.