I have three nodes named: A,B and C and there is a relationship between A->B and B->C named 'EDGE', which has a property named cost.
So I am trying to find out the total cost from A to C, using the relationships() function to first find the edges in between and then sum up the cost on edges/relationship using sum() function. So my query becomes:
SELECT * from cypher('demo_graph', $$
MATCH p = (a:Vertex {name: 'A'})-[:EDGE*]->(c:Vertex {name: 'C'})
WITH relationships(p) AS edges
RETURN sum(edge.cost) AS totalCost
$$) as (V agtype);
But this query return the following error:
Do someone know what can be the reason?