Is $current not working with traverse?

66 views
Skip to first unread message

Vitor Enes Duarte

unread,
Apr 8, 2015, 4:55:39 AM4/8/15
to orient-...@googlegroups.com
Hi,

create class TestV extends V
create
class TestE extends E


create vertex
TestV set name = 'test1'
create vertex
TestV set name = 'test2'
create vertex
TestV set name = 'test3'

create edge
TestE from (select from TestV where name = 'test1') to (select from TestV where name = 'test2')
create edge
TestE from (select from TestV where name = 'test2') to (select from TestV where name = 'test3')



select $all, $current from TestV
let $all
= (traverse out('TestE') from $current )


select $all, $current from TestV
let $all
= (traverse out('TestE') from (select from TestV where name = 'test1') )


The first query does not return the expected and the second query shows that the first should work.
Is there a problem with $current here, or am I doing something wrong?

Message has been deleted

Vitor Enes Duarte

unread,
Apr 14, 2015, 3:08:35 PM4/14/15
to orient-...@googlegroups.com
Sorry to push this.
Is this an issue or am I missing something?

Luigi Dell'Aquila

unread,
Apr 15, 2015, 5:00:32 AM4/15/15
to orient-...@googlegroups.com
Hi Vitor,

I'm looking at that (actually thanks to this I found a regression on 2.1-snapshot and I'm fixing it too).
I'll give you a feedback ASAP

Luigi


--

---
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 orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Luigi Dell'Aquila

unread,
Apr 15, 2015, 5:08:48 AM4/15/15
to orient-...@googlegroups.com
Ok, I think there is a problem in the first query. I guess in the inner traverse, when you use the $current variable, you are referring to the current record in parent select, right?
In this case you have to use $parent.$current 

so the query should be

select $all, $current from TestV

let $all 
= (traverse out('TestE') from $parent.$current )

Let me know if it works for you


BTW, I also fixed the regression on 2.1 and pushed it in develop branch, so it also works there.

Thanks

Luigi



Vitor Enes Duarte

unread,
Apr 15, 2015, 5:25:35 AM4/15/15
to orient-...@googlegroups.com
Yes. I just read the docs again and its there. Sorry for the trouble.
Waiting for 2.1 :)


Thanks,
Vitor,
Reply all
Reply to author
Forward
0 new messages