orientdborientdb2.2orientdb-2.1orientdb-etl

Traverse through vertices using SELECT query, just like MATCH. Is it possible?


Traverse through vertices using SELECT query, just like MATCH. Is it possible in OrientDB?


Solution

  • SELECT statement allows you to traverse relationships using out()/in()/both() methods, eg. find friends of friends:

    SELECT expand(out("FriendOf").out("FriendOf")) from Person WHERE name = 'John'
    

    The SELECT in general is much less flexible than a MATCH, but it's powerful enough for basic use cases