Hi Riccardo,

your root node name is 'root', so it does not match your traversal
condition ;-)
Try with this:

TRAVERSE out() FROM (SELECT FROM V WHERE name = 'root') WHILE name = '2.3' or
$depth = 0

I hope I understood correctly your problem... the result will be the
following:
suppose you have this chain:

A:'root' -> B:'2.3' -> C:'2.3' -> D:'something else'

you will obtain
A
B
C

Luigi




2015-09-18 9:20 GMT+02:00 Riccardo Tasso <[email protected]>:

> Hi, I am trying to understand the potential of TRAVERSE command (
> http://orientdb.com/docs/2.1/SQL-Traverse.html ).
>
> The documented examples, which all use the $depth context variable are
> clear.
>
> I can't figure out how to use other variables, first of all $current.
> Consider this toy-dataset:
>
> create database memory:tmp admin admin
> insert into V set name = 'root'
> insert into V set name = '1'
> insert into V set name = '2'
> insert into V set name = '1.1'
> insert into V set name = '1.2'
> insert into V set name = '2.1'
> insert into V set name = '2.2'
> insert into V set name = '2.3'
> create edge from #9:0 to #9:1
> create edge from #9:0 to #9:2
> create edge from #9:1 to #9:3
> create edge from #9:1 to #9:4
>
> I would expect to find something with those query, but no result is
> returned:
> TRAVERSE out() FROM (SELECT FROM V WHERE name = 'root') WHILE name = '2.3'
> TRAVERSE out() FROM (SELECT FROM V WHERE name = 'root') WHILE $current.name
> = '2.3'
>
> Is there any possibility to stop the TRAVERSE with some condition on the
> current vertex?
>
> Thanks,
>    Riccardo
>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "OrientDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to