neo4j stop traversal on condition (cypher) -
i'm starting out pardon me if stupid question wondering how stop traversal of tree on node property value.
for instance. if have tree type graph nodes , subnodes. nodes have property of published
either 1
or 0
. traverse tree not including node published:0
(nor it's children if have published:1
)
so far (with n being root node) n-[:has_child_content*]->m m.published=1 return m;
return published nodes ignoring fact nodes have unpublished parent
can me sort out? in advancce.
ps: i'm using neo4j - graph database kernel 2.0.0-m02
through webapp cypher shell on ubuntu 12.04 lts
you can examine path, like
match p=root-[:parent*..]-file root.name='a' , all(x in nodes(p) x.published = true) return p;
http://docs.neo4j.org/chunked/preview/query-function.html#functions-all
see http://bit.ly/12arbl5 example.
Comments
Post a Comment