Hi all,

I have a class named Area and one named Device. One area could be part of 
another via the HasArea edge and a device could be part of an Area via a 
HasResource. The problem is that, when I query all areas, I would like to 
receive also the RIDs of all Devices that are part of it. And by being part 
I mean even if it is a Device of a sub-area. That is, if I have a House as 
the root area, a bathroom with Device1 and a Kitchen with Device 2, the 
House should also have both Device1 and Device2 in a column.

I have managed to do that, but only if I query for every Area in separate. 
For instance, in the example bellow #21:0 is an Area.

select unionall(devices) as devices from (select @rid, name, 
out('HasResource') as devices from (traverse out('HasArea') from #21:0))

However, I would like to be able to do that in a single query, if possible. 
Anyone know how to accomplish that in a single OSQL query?

Regards, Lucas Lira Gomes.

-- 

--- 
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