I have a graph and I would like to obtain the list of degrees (across the nodes). The following statement does the trick :
match (n:PROF)-[r]-() with n, count(r) as degree return degree
There's however, something I don't get in the logic. When I write this statement :
match (n:PROF)-[r]-() with count(r) as degree return degree
or this one
match (n:PROF)-[r]-() return count(r) as degree
I get the sum of the counts across the nodes, not the counts as a list.
I also realised that this statement
match (n:PROF)-[r]-() return n, count(r) as degree
also returns each degree. But it also has the nodes in the returned table...
So it seems that the fact that "n" is return (or passed further with "with") changes the format of the response. Is there somewhere a document that explains this logic ?
So it seems that I have to return the nodes (with n)