I'm didn't find a good and, at the same time, clean way to search complete paths that constains a specific node. The solution that I reach is giving me the following warning:
This feature is deprecated and will be removed in future versions.
Binding relationships to a list in a variable length pattern is deprecated. (Binding a variable length relationship pattern to a variable ('r1') is deprecated and will be unsupported in a future version. The recommended way is to bind the whole path to a variable, then extract the relationships: MATCH p = (...)-[...]-(...) WITH *, relationships(p) AS r1)
EXPLAIN MATCH p=(n1:WaterNode)-[r1:CONNECTED*]->(n:WaterNode{name:"Pisão", type:"Barragem"})-[r2:CONNECTED*]->(n2:WaterNode)
^
Hello @koji , I'm trying to collect all paths p which uses the relation CONNECTED and contains a specific node WaterNode{name:"Pisão", type:"Barragem
// Find all full paths that contains a specific water node
// Ex. name:"Pisão", type:"Barragem"
MATCH p=(n1:WaterNode)-[r1:CONNECTED*]->(n:WaterNode{name:"Pisão", type:"Barragem"})-[r2:CONNECTED*]->(n2:WaterNode)
RETURN collect(p)
I'm not sure about what i'm doing wrong when you say then you don't need any other variables..
I'm new with this, but * gives all the link between 2 nodes, rigth? With (n1:WaterNode)-[r1:CONNECTED*]->(n:WaterNode{name:"Pisão", type:"Barragem"}) I'm getting all paths from back of the node and with (n:WaterNode{name:"Pisão", type:"Barragem"})-[r2:CONNECTED*]->(n2:WaterNode) I'm getting all paths upfront.
Thank you