Hi all,

I have a problem when traversing the graph and would like to ask for some help.

As the graph I show in the attached picture, I would traverse from the node with blue border with 3 levels and return nodes of the third level , the expected result should be only the node with yellow border, but actually it returned not only the node with yellow border but also the node with red border. So, how can I get my expected result?

My query is as below, and my orientdb version is 3.0.13:

match {Class:NODE1,as: n,where:(node_id=‘193403’)}.both(‘hasLink’)

{as:m ,where: ($matched.n != $currentMatch and $depth > 2) ,while:($depth < 3)}

return distinct n.node_id, m ,m.node_id ,m.node_type