Return e(edge) in traversal in ArangoDB

27 Views Asked by At
FOR v, e, p IN 1..2 INBOUND 'company_nodes_2018_2023/6066a658fee3c9fc8c1c84b7' 
GRAPH supply_chain_graph
OPTIONS { uniqueVertices: 'path', maxIterations: 100000}
FILTER p.edges[0].hs_codes == 820559 AND p.edges[1].hs_codes == 950300 AND p.edges[*].actual_arrival_date ALL >= '2018-01' AND p.edges[*].actual_arrival_date ALL <= '2023-02' 
LIMIT 500000
RETURN e

In the above query it is returning only one edge that is of 1st level which has hs_codes == 950300. Edge of level 0 containing 820559 is not shown . Can anyone please tell me why.

1

There are 1 best solutions below

0
Shahar Shokrani On

Yes it is by definition:

edge (object, optional): the current edge in a traversal

Means e is changing based on the depth of the current iteration (that why you are seen only the last one).

Instead of returning the e, if you want both of the edges you should return p.edge[0] and p.edge[1].