Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-30-2022 11:28 AM
I have a graph and I would like to obtain the list of degrees (across the nodes). The following statement does the trick :
09-30-2022 02:53 PM - edited 09-30-2022 02:54 PM
the use of an aggregate function, such as count, causes the data to be grouped by the other items returned. These are called grouping keys. The aggregation we be applied over each unique combination of those parameters. This is true for aggregate functions on both ‘return’ and ‘with’ clauses. This is very similar to a SQL ‘group by’ clause.
https://neo4j.com/docs/cypher-manual/current/functions/aggregating/
10-02-2022 12:14 AM
Try this: This shows all the relationships associated with node 'PROF'. Also shows count of each relationship type.
match (n:PROF)-[r]-()
with distinct type(r) as rel, count(distinct type(r)) as cnt
with collect(rel) as rels, collect(cnt) as cnts
return rels, cnts
All the sessions of the conference are now available online