+2 votes
in Databases by (34.9k points)
I want to count the number of nodes in each label in a given Neo4J database. What is the Cypher query for it?

1 Answer

+2 votes
by (157k points)
selected by
 
Best answer

You can try the following Cypher query to get the count of nodes for each label. The query will return node labels and their node count.

MATCH (n)
RETURN labels(n) as NodeLabel, count(labels(n)) as LabelCount;

 


...