I'm using ArangoDB 3.0 and I want to create an AQL query to get the shortest path from A to B, with depth = 3, filtering on some edge properties.
The "ArangoDB 2.0" version of the query, would like be the following:
FOR e IN GRAPH_SHORTEST_PATH('CityGraph', 'city/rome', 'city/turin',
{
edgeExamples: [{filterProperty: 'FIRST'}, {filterProperty: 'SECOND' }]}
)
I read the documentation about arangoDB 3.0 (https://docs.arangodb.com/3.0/AQL/Graphs/ShortestPath.html), and it says:
Conditional shortest path
The SHORTEST_PATH computation will only find an unconditioned shortest path. With this construct it is not possible to define a condition like: "Find the shortest path where all edges are of type X". If you want to do this, use a normal Traversal instead with the option {bfs: true} in combination with LIMIT 1.
So, can someone tell me what type of AQL query I can do it? According with the suggestions, I write this:
FOR n, e IN 1..3 ANY 'city/rome' GRAPH 'CityGraph' OPTIONS {bfs: true} FILTER e.filterProperty IN ['FIRST', 'SECOND'] LIMIT 1 return {n, e}
But it returns only the first level of graph depth, instead of a depth of n.
Thank you in advance.
Best regards,
Daniele