Reputation: 45
I have a graph with a large number of nodes that have a "category" as a property (or I could re-structure the data to have that category be a node label if that makes it easier). I am looking for a way to query the graph to return all the possible "categories" in the graph along with the counts of all the nodes for each.
Upvotes: 1
Views: 114
Reputation: 9369
This should work:
MATCH (n)
WHERE has(n.category)
RETURN DISTINCT n.category, count(n)
Upvotes: 2