I am trying to set an edge attribute based on some aggregation of the values of its source and target nodes. I have tried many things but none seem to work, what I want is basically this
MATCH (s)-[r]-(t) SET r.new_property = avg(s.property, t.property)
same for min and max aggregations. I know the above query is syntactically incorrect, but is there a way to get the desired result?
I am also interested in setting a node property based on some aggreagtion of the connected relationships
MATCH (s)-[r]-() SET s.new_property = avg/min/max(r.property)
Please help!