Batch query with Multiple id(or other field)

23 views
Skip to first unread message

zhanbing...@gmail.com

unread,
May 21, 2016, 10:30:13 AM5/21/16
to OrientDB
 Hi, everyone:

 I create two classes,

 create class person extends V
 create property person.id string
 create property person.name string
 create index person.id on person(id) unique
 

 create class friendship extends E
 create property friendship.in link person
 create property friendship.out link person
 create index friendship.in_out on friendship (in,out) unique 


I can get the friends of one person with this sql:
select expand(out('friendship')) from person where id='0001'

if i give a id list, with sql
select expand(out('friendship')) from person where id in ['0001','0002',...,'000n']

I get the a list of OrientRecord, from the result, I can not know which record is get from '0001',

how can i get a query result like :
0001  OrientRecord
0001  OrientRecord
0002  OrientRecord
0002  OrientRecord
0003  OrientRecord

or like this 
[[OrientRecord, OrientRecord],[OrientRecord, OrientRecord],[OrientRecord]]

thanks

zhanbingliu



scott molinari

unread,
May 22, 2016, 3:50:49 AM5/22/16
to OrientDB
http://orientdb.com/docs/last/SQL-Query.html

Scroll down to "Unwinding" towards the bottom of that page. That might be what you are looking for.

Scott
Reply all
Reply to author
Forward
0 new messages