I have two Person Nodes.
(p:Person {Name: 'Anthony'})
(p:Person {Name: 'Jason'})
The required Relationship is:
(p:Person)-[KNOWS]-(s:Skill) //s is dynamically entered
To Achieve this, I used the Query:
MATCH (p:Person)
WHERE p.Name='Anthony'
MERGE(p)-[r:KNOWS{Weight:83}]-(x:Skill {Name:"WordPress"})
However, if I try it again with:
MATCH (p:Person)
WHERE p.Name='Jason'
MERGE(p)-[r:KNOWS{Weight:80}]-(x:Skill {Name:"WordPress"})
The Node (s:Skill {Name: 'WordPress'}) is created again.
I understand that MERGE will match the entire pattern but how can I ensure that this query only creates the Skill Node if it does not exist?