I'm currently working on orientdb, and I'm having a hard time how to merge to rows or a two result. I just want to merge the two vertex in an edge, i tried unionall but it doesn't work in my side, please help me.
I already used unionall, unwind, and bothV() but not working.
person and company is a vertex
is_working is an edge(from(person), to(company))
i want to merge the result of the two vertices
ex.
select expand(bothV()) from is_working where in = '13:3'
i just want to get all users that is working on the specific company.
expected result:
{name: "Randolf", gender: "Male", company_name:"Name of the company"},
{name: "Jefferson", gender: "Male", company_name:"Name of the company"}
I already tried the code below
select person, company.*
from (select person, in('is_working') as company
from(select expand(out('is_working'))
from #13:2)
unwind company)
select expand($all) let
@a = (select expand(in('is_working') from company where @rid = '13:2'),
@b = (select expand(in('is_working').out('is_working')) from company where @rid = '13:2'),
@all = unionall(@a, @b)
Nothing error but it doesn't show any result.
when i tried
"select expand(bothV()) from is_working where in = '13:3'"
there is a result but it's not merge.
by the way the 13:2 and 13:3 is the RID of my company