A solution (there is in fact multiple ways to go about it) would perhaps be 
the following:

SELECT in.*, strength FROM (SELECT outE("E") FROM FOO)

What this does is that it first selects the edge and then selects anything 
of interest. By doing this you follow the path as it is saved in the 
database and the performance should be rather good.
Note that I start from the id FOO. This is also a performance improvement, 
instead of first finding FOO and then traverse we start from FOO 
straightaway. 

This does not however return the data as you want, it will be returned as 
one single non-nested json. But that shouldn't be a problem for you to 
handle I believe.

On Monday, April 27, 2015 at 2:18:13 PM UTC+2, Charles Bandes wrote:
>
> Hi - I'm building a graph to display via d3's force-directed layout.
>
> In order to find the links, I'm running a query like this:
>
> SELECT expand(out("E")) from V where id=FOO;
>
> This gives me an array of all the objects that are connected to FOO by an 
> edge. That's fantastic.
>
> But I also have a property on the edge called "strength" which indicates 
> the strength of the connection. How do I access that? 
>
> Ideally what I want to get is something like this:
>
> result: [
>   {
>     object: { THE VERTEX },
>     strength: STRENGTH_VALUE
>   }
> ]
>
> Does that make sense? Am I going about it all wrong? 
>
>

-- 

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