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
Post a Comment