Hi all, I am using apoc procedures to perform a breadth first search but I think I have not quite gotten the syntax right.
I have my database of dependencies loaded and as an example if I execute this cypher
match (n:Node)-[:Depends_On]->(e:Node) where n.name = "BankAccount" return n, e
I get my expected results that shows my everything that is dependent on 'BankAccount'
Now I am trying to execute a breadth first search and I want to start at 'BankAccount' and get all the immediate dependencies on 'BankAccount' AND I then want to get ALL of the dependents dependencies as well until there are no more dependencies.
I have managed to come up with this cypher so far
MATCH (n:Node)
WHERE n.name = 'BankAccount'
CALL apoc.path.expandConfig(n,{relationshipFilter:"Depends_On",maxLevel:1,uniqueness:"NODE_GLOBAL"}) YIELD path
WITH n, RELATIONSHIPS(path) as r, LAST(NODES(path)) as es
WHERE es:Node
RETURN n,es,r
but this is not returning the results as I might have expected, I am actually getting the following
I am maybe misunderstanding something but this doesn't look right to me as the relationship arrows all seem to be pointing inwards towards my starting node 'BankAccount'. I am thinking that this should look like my first image but with the addition of all the depenendent dependencies shown also?
Can anyone see what I am doing wrong here?