cypher - Neo4J - Test nodes on path with unknown depth, with MATCH only -


i want test nodes in path node node b (with match statement), depth changing (could number). in example below depth 2.

start = node(86)  match p0 = a-[*..2]-b  (b.attr = 'true') , (a.attr = 'true') return p0  

my question how test nodes between , b attribute (attr = 'true'), using match statement, without knowing depth required.

i find using filter method can filter out unwanted nodes. like:

start = node(86)  match p0 = a-[*..2]-b  return filter(x in nodes(p0) x.attr = 'true') 

but not need, need use match.

take @ cypher refcard, list predicates section. all() function should trick.

something like:

start a=node(86)  match p0=(a)-[*..2]-(b)  all(node in nodes(p0) node.attr = true) return p0  

this match patterns nodes in pattern have attribute true.


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -