Skip to content

Instantly share code, notes, and snippets.

@retrography
Created June 21, 2014 17:18
Show Gist options
  • Save retrography/d755eb2943735d7cecb2 to your computer and use it in GitHub Desktop.
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
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