Created
December 29, 2016 16:51
-
-
Save guillaumegarcia13/fa0db0d5a31e97207cb263b41890bd20 to your computer and use it in GitHub Desktop.
Neo4j: Count all relations per node types
This file contains hidden or 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 (n)-[r]->(m) | |
WITH HEAD(LABELS(n)) AS label_n, type(r) as type_r, HEAD(LABELS(m)) AS label_m | |
RETURN type_r, label_n, label_m, COUNT(*) | |
ORDER BY type_r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment