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

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

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

laravel - Undefined property: Illuminate\Pagination\LengthAwarePaginator::$id (View: F:\project\resources\views\admin\carousels\index.blade.php) -