I am trying to do a graph traversal here
I created two collections in ArangoDB, a document collection "Node"
and an edge collection "Path"
. All my nodes have a name
attribute (labels) and are connected by edges (lines) as shown in above illustration.
I tried below query to find paths that end with an end or error node:
FOR v, e, p IN 1..10 OUTBOUND 'Node/start_0' Path
OPTIONS { bfs: true}
FILTER (v.name == "end" OR v.name == "error")
RETURN CONCAT_SEPARATOR(' - ', p.vertices[*].name)
The above query works as expected and returns me two paths:
["start - decide - execute1 - error"
"start - decide - execute2 - end"]
But I am exploring how to eliminate all corresponding paths that pass through a particular node. For example, I want to eliminate all paths that pass through execute1. I tried this query:
FOR v, e, p IN 1..10 OUTBOUND 'Node/start_0' Path
OPTIONS { bfs: true}
FILTER ((v.name == "end" OR v.name == "error") AND v.name != "execute1")
RETURN CONCAT_SEPARATOR(' - ', p.vertices[*].name)
But it doesn't work - it still returns me the two paths.
Can any one help me on how to reframe this query to make it return only one path, i.e. "start - decide - execute2 - end"?