Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get different labels and their count in neo4j by cypher query?

I was needing to check what different labels present in graph database neo4j.

How to get different labels and their count in neo4j by cypher query?

like image 630
Somnath Muluk Avatar asked Apr 28 '14 07:04

Somnath Muluk


1 Answers

I finally found a solution to the multiple label problem that is less complicated:

MATCH (a) WITH DISTINCT LABELS(a) AS temp, COUNT(a) AS tempCnt
UNWIND temp AS label
RETURN label, SUM(tempCnt) AS cnt
like image 113
accidental_PhD Avatar answered Oct 18 '22 19:10

accidental_PhD