include  method returns json string so  

if it accepts *  and  depth level like include(* [,depthlevel])  default 
depth level 0 ; 

  will be great to usage and simplefies the  queries for (Embeded , Linked 
Documents   )

for example 

Product : name  , price, category(embedded or linked)  

Category :  name  , parent_category(Embeded or linked) 

Order = orderdate , product(embedded or linked) 

select orderdate , product.include(*)  from Order  

result will include 
{
"orderdate" : '2015-01-01', 
"product":{
"name":"Samsung Galaxy", 
"price":"15$"
}
}
 
if depth level is 1  then 

select orderdate , product.include(*,1)  from Order  

{
"orderdate" : '2015-01-01', 
"product":{
"name":"Samsung Galaxy", 
"price":"15$",
"category":{
"name":"Smart Phones"
}
}
}
if depth level is 2 then the parent_category will be inside ....   one 
single query will return complex json object 



*for Edges will be usefull Alias *

What you think about  this case for putting alias  at the example ...   

select  title,content ,  outE('comment').include('content') as comment , 
out('comment').include('profile_pic') as  *comment.writer*    from content 




json result = 

{
"title":'asasdas',
"content":'assadsasd',
"comment":[
 {
   "content":"hi great content",
  

* "writer":{     "profile_pic": "me.png"*

*   }*
*           }*
      ]
}
if just alias  has  property  to put it to json 
currently   it is doing  this ...  
select  title,content ,  outE('comment').include('content') as comment , 
out('comment').include('profile_pic') as  comment   from content 




json result = 

{
"title":'asasdas',
"content":'assadsasd',
"comment":[
 {
   "content":"hi great content", 
           }
      ],
"writer" :[
 {
     "profile_pic": "me.png"
   }
]
}


-- 

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