Created
June 21, 2014 17:18
-
-
Save retrography/d755eb2943735d7cecb2 to your computer and use it in GitHub Desktop.
Basic Neo4j Cypher query to link all the individuals in the graph database using the same email address
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MATCH (a:Person), (b:Person {email:a.email}) | |
WHERE HAS(a.email) AND HAS(b.email) | |
AND a.email IS NOT NULL AND b.email IS NOT NULL | |
AND a<>b | |
CREATE UNIQUE (a)-[i:IS]-(b); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment