No, sorry, you don't need the SELECT and the UNWIND, you can just use the
inner match:

MATCH {class: Folder, as: parent}.outE("parent_of"){as: theEdge, optional:
true} RETURN parent, theEdge, theEdge.inV() as child

(there was also a mistake in my previous answer, it was inV(), not in() )

Thanks

Luigi


2017-04-02 11:22 GMT+02:00 Luigi Dell'Aquila <[email protected]>:

> Hi Nicolas,
>
> I'm afraid it's not supported yet, you can work around it with a
> SELECT/MATCH like follows:
>
> SELECT FROM (
>   MATCH {class: Folder, as: parent}.outE("parent_of"){as: theEdge,
> optional: true} RETURN parent, theEdge, theEdge.in() as child
> ) UNWIND child
>
> I hope it helps
>
> Thanks
>
> Luigi
>
>
>
> 2017-03-31 14:20 GMT+02:00 nicolas treiber <[email protected]>:
>
>> Hello,
>>
>> I'm facing a problem with a MATCH query in orientDB 2.2. I have a folder
>> tree structure (a 'Forlder' node, and a 'parent_of' edge) and I have data
>> on the relationships. What I try to achieve is to get all the tree at once
>> with the relationships data. I successfully got the tree without the data
>> that way:
>> MATCH {class: Folder, as: parent}-parent_of->{class: Folder, as: child,
>> optional: true} RETURN parent, child
>> (I need the optional set to true to get the folders with no child)
>>
>> To get the edges' data I proceeded that way:
>> MATCH {class: Folder, as: parent).outE('parent_of'){as:
>> edge}.inV(){class: Folder, as child, optional: true} RETURN parent, edge,
>> child
>> But it acts like there were no "optional", and folder without any child
>> are ignored.
>> I tried to add "optional: true" to the edge, but it unauthorized.
>> And finally i tried:
>> MATCH {class: Folder, as: parent).(outE('parent_of'){as:
>> edge}.inV()){class: Folder, as child, optional: true} RETURN parent, edge,
>> child
>> With that i have all the folders but edge is always empty, like if the
>> aliases in parenthesis were ignored.
>>
>> How can I fix that ?
>>
>> --
>>
>> ---
>> 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