I believe using the Array subscript operator we can handle this.

select empno,lastName,firstName,out("WorksAt").include("name").name[0] as 
deptname from Employee 

This way i can get results like below
   {
            "@type": "d",
            "@rid": "#-2:0",
            "@version": 0,
            "empno": 101,
            "lastName": "Jacob",
            "firstName": "John",
            "deptname": "HR"
        },

while without using subscript operator i was getting results like below 
where deptname was coming as an array
{
            "@type": "d",
            "@rid": "#-2:0",
            "@version": 0,
            "empno": 101,
            "lastName": "Jacob",
            "firstName": "John",
            "deptname": [
                "HR"
            ]
        },


On Friday, September 4, 2015 at 10:49:20 AM UTC-4, Susheel Kumar wrote:
>
> I mean result returned as document object.  Any function to just get the 
> scalar form along with columns from other Employee vertex.
>
> On Thursday, September 3, 2015 at 10:23:46 PM UTC-4, Susheel Kumar wrote:
>>
>> Thanks, Michela and it works in one sense but returns the result as 
>> array. for e.g.
>>
>> select empno,lastName,firstName,out().include("name") as deptname from 
>> Employee
>>
>> returns deptname as [{"@type":"d","@version":0,"name":"HR"}]
>>
>> now if i just execute without include like below 
>> select empno,lastName,firstName,out().name as deptname from Employee
>>
>> returns deptname as ["HR"].
>>
>> Do you know why it is getting returned as array?
>>
>> Thanks,
>> Susheel
>>
>> On Thursday, September 3, 2015 at 8:15:08 PM UTC-4, [email protected] 
>> wrote:
>>>
>>> Hi Susheel,
>>>
>>> I hope that this is what are you looking for:
>>>
>>> SELECT empno,empname,out().include("deptno") as deptno,out().include(
>>> "deptname") as deptname FROM Employee
>>>
>>> Let me know if it is what are you looking for
>>>
>>> Regards,
>>> Michela
>>>
>>

-- 

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