I want to know, if it's possible to calculate & set (update) a node property based relation properties (incoming&outgoing)?
In my example, I would like to calculate an user personal "strength factor" (Kind of average) based on his relationships duration (int) divided by the count (int).
Thanks for your help in advance,
Cheers
解決方案
Yes, it's possible. The only trick is that you have to use WITH to first perform the aggregation (for calculating the average):
MATCH (n)-[r:RELTYPE]->()
WITH n, avg(r.duration) AS strength
SET n.strength = strength