jatin patware
jatin patware

Reputation: 141

Cypher to sum the weight of all incoming edges to a particular node in Neo4j?

I want to get the summarized weight of all incoming edges to a particular node in neo4j For eg. S. Keshav has to incoming weighted edge , first having weight =2 and second having weight=4 , I need answer=6

Sample data model

Upvotes: 1

Views: 451

Answers (1)

Bruno Peres
Bruno Peres

Reputation: 16365

You can do it using the sum() function:

match ()-[r]->({name : 'S. Keshav'})
return sum(r.weight)

Upvotes: 4

Related Questions