how to select and include linked document in response

21 views
Skip to first unread message

ad...@cs.miami.edu

unread,
Aug 29, 2017, 11:03:09 PM8/29/17
to OrientDB
Hi,

I am using the document model and trying to do something that should be easy.  I have two classes: Person and House.

Person has a property (named "home") which is a link to a House (embedded set?).

I currently have only one instance in each class:

Select * from Person


returns the "home" property with a reference (#22:0).  I could do two selects (another one with the @rid of the home), but this seems to be inefficent.  How do I in one select get all the properties of the Person with the embedded House included as well.

I thought Select *, expand(home) from Person would work but it only includes the expanded Home.

Best,

-Adam

ad...@cs.miami.edu

unread,
Aug 29, 2017, 11:36:40 PM8/29/17
to OrientDB
I should have spent a few more minutes reading the docs before I posted my question.

Incase anyone else has the same question, look at the "fetchplan" sql command.  This is what worked for me to load the linked document (very powerful!):

select * from Person fetchplan *:-1
Reply all
Reply to author
Forward
0 new messages