neo4j - How to sum attributes grouped by some predicate -



neo4j - How to sum attributes grouped by some predicate -

i have many nodes , relationships of form:

(e:employee)-[r:charged_project { hours: 10 }]->(p:project { name : "foo")

how can formulate query give me list of projects, along total number of hours charged against them? (that is, sum of "hours" properties on inbound :charged_project relationships)

you can utilize sum function aggregate on set of results , calculate sum of hours:

match (p:project)<-[r:charged_project]-() homecoming p.name, sum (r.hours)

neo4j cypher

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -