I am playing with Neo4j and Cypher, however, I ran into a problem that I couldn't solve yet.
Let's say we have a node like this: (p:Person{name: "Joe"})
Then, I would add a new Person node to my database which too had a name: "Joe" property.
I would like to create a relationship between the first Person Joe and the new Person Joe (and only between them!).
So far I've tried the following query, which is not getting what I want:
MATCH (p1:Person)
WHERE p1.name = "Joe"
CREATE (p2:Person{name:"Joe"})-[r:SAME_NAME]->(p1))
The problem now is that it's kind of recursively creating new nodes. How can I achieve the desired query?