so in neo4j, I have company nodes and relationships between them as invoices, relationship propertys as invoice amount and products description. I want to sum relationships amount to be left only one arrow, and sumerized amount, i don't want to delete relationships from db. i added this query to the bloom scene action but cant get any result
match(n:company)-[r:invoice]->(m:company)
where id(n) in $nodes
with n, m, sum(r.amount) as total, collect(r) as relationships
where size(relationships) > 1
with total, head(relationships) as keep, tail(relationships) as delete
set keep.w = total
foreach(r in delete | delete r)
return *