Exposing traversal depth from MATCH

27 views
Skip to first unread message

leo...@kensho.com

unread,
Sep 26, 2016, 5:14:11 PM9/26/16
to OrientDB
Hi.

Is there any way of exposing $depth context variable from the MATCH statement to the result consumer.
E.g. in the documentation example I'd like to get the actual degree of separation between a pair of people (I don't care which path) as part of the output. 

Thanks
-=- Leonid

user.w...@gmail.com

unread,
Sep 26, 2016, 5:18:07 PM9/26/16
to OrientDB
Hi,

can you explain it better?

Thx

Regards,
Michela

Oleksandr Gubchenko

unread,
Sep 27, 2016, 12:29:00 AM9/27/16
to orient-...@googlegroups.com
$depth is used in while condition, so you define it.
Are you looking for shortest/longest path?

If you are using MATCH you can't return $depth, as workaroud you can use it with select:
SELECT @rid,$depth FROM (TRAVERSE * FROM V)

If you need to use it with MATCH you can open a request on github.

Alex.
Reply all
Reply to author
Forward
0 new messages