Luca-
This seems to me to be a big problem.
If you have a graph, for example people->owns_car->cars.
Sam->@rid:13:2, name:Honda
Sam->@rid: 13:3, name:Toyota
Sam->@rid: 13:4, name:Mercedes
Sam = @rid: #12:1
if you run this query: select out_owns_car.in.name as names from #12:1
will return
names: [Honda, Toyota, Mercedes]
if you run this query: select out_owns_car.in.@rid as rids,
out_owns_car.in.name as names from #12:1
will return
rids: [full expansion of every connected vertice along with the rids of all
edges]
names: [Honda, Toyota, Mercedes]
This behavior is inconsistent. If I query out_owns_car.in, then I should
get the full expansion of every connected vertex. If I query
out_owns_car.in.@rid, I just want an array of the rid values, the same as
the array I get back when I query the name values of each connected vertice!
I don't think it matters so much, as long as there is a way to achieve
this. Otherwise, you have to pull the full data for every vertice just to
get the permanent rid values, which takes up much more bandwidth than
necessary and is likely much slower than just pulling the value of the rid.
There must be another way to query this directly, no?
On Tuesday, February 11, 2014 12:56:05 AM UTC-5, Shishya wrote:
>
> This works.
> var db = orient.getGraph();
>
> var pt = db.command("sql","select * from ZTitleID where pat_id = ?", [id
> ]);
> var res = pt[0].getRecord();
>
> return res.field('DT');
>
>
>
> Might help someone.
>
> Thanks
>
> On Tuesday, February 11, 2014 9:58:21 AM UTC+5:30, Shishya wrote:
>>
>> Hi Luca,
>>
>> yet again, now select on other fields are not working. I am sure, I am
>> missing something silly
>>
>> var pt = db.command("sql","select @rid,DT from ZTitleID where pat_id =
>> ?", [id]);
>> return pt[0].rid + pt[0].DT + pt[0].getIdentity();//Error on all 3
>>
>> How to get fields and identity in a single query. Or do i need separate
>> queries for each?
>>
>> Regards
>>
>>
>> On Monday, February 10, 2014 6:43:36 PM UTC+5:30, Shishya wrote:
>>>
>>> Wallah ! works.
>>>
>>> Thanks a lot!
>>>
>>> On Monday, February 10, 2014 6:16:28 PM UTC+5:30, Lvc@ wrote:
>>>>
>>>> Try:
>>>>
>>>> res[0].getIdentity()
>>>>
>>>>
>>>> On 10 February 2014 13:40, Shishya <[email protected]> wrote:
>>>>
>>>>> res[0] gives v(ZTitleID)[#11:0]
>>>>>
>>>>> Am I doing the correct array browsing. I see there is only 1 element
>>>>> in that object.
>>>>>
>>>>> Regards
>>>>>
>>>>>
>>>>> On Monday, February 10, 2014 5:54:15 PM UTC+5:30, Lvc@ wrote:
>>>>>
>>>>>> res is an array of vertices (ZTitleID extends V), so you should
>>>>>> browse res array and get single entry's identity.
>>>>>>
>>>>>> Lvc@
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 10 February 2014 13:18, Shishya <[email protected]> wrote:
>>>>>>
>>>>>>> Code
>>>>>>> var db = orient.getGraph();
>>>>>>> var res = db.command("sql","select * from ZTitleID where pat_id = ?"
>>>>>>> , ['06615119']);
>>>>>>> //res
>>>>>>>
>>>>>>> I expect res to contain rid but contains vZTitleID[#11:0]
>>>>>>>
>>>>>>> Regards
>>>>>>>
>>>>>>>
>>>>>>> On Monday, February 10, 2014 4:57:52 PM UTC+5:30, Lvc@ wrote:
>>>>>>>
>>>>>>>> That is an array, so you should get the RID on each element of the
>>>>>>>> array.
>>>>>>>>
>>>>>>>> What API have you used to do the query? Please could you post the
>>>>>>>> code of that function?
>>>>>>>>
>>>>>>>> Lvc@
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On 10 February 2014 12:23, Shishya <[email protected]> wrote:
>>>>>>>>
>>>>>>>>> I get the following error
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> sun.org.mozilla.javascript.internal.EvaluatorException: Java
>>>>>>>>> class "[Ljava.lang.Object;" has no public instance field or method
>>>>>>>>> named
>>>>>>>>> "getIdentity". (<Unknown source>#65) in <Unknown source> at line
>>>>>>>>> number 65
>>>>>>>>> Java class "[Ljava.lang.Object;" has no public instance field or
>>>>>>>>> method named "getIdentity". (<Unknown source>#65)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Monday, February 10, 2014 4:32:54 PM UTC+5:30, Lvc@ wrote:
>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>> if you're working with graph API get it as:
>>>>>>>>>>
>>>>>>>>>> .getIdentity()
>>>>>>>>>>
>>>>>>>>>> Lvc@
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On 10 February 2014 11:46, Shishya <[email protected]> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> I have been struggling with getting RID from select/create
>>>>>>>>>>> through javascript functions return in select or create. What I get
>>>>>>>>>>> is this
>>>>>>>>>>> format, v(ZTitleID)[#11:0]
>>>>>>>>>>>
>>>>>>>>>>> Any idea for how to get rid like #11:0 from this?
>>>>>>>>>>>
>>>>>>>>>>> Please help
>>>>>>>>>>>
>>>>>>>>>>> Regards
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>>
>>>>>>>>>>> ---
>>>>>>>>>>> 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/groups/opt_out
>>>>>>>>>>> .
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>
>>>>>>>>> ---
>>>>>>>>> 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/groups/opt_out.
>>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>
>>>>>>> ---
>>>>>>> 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/groups/opt_out.
>>>>>>>
>>>>>>
>>>>>> --
>>>>>
>>>>> ---
>>>>> 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/groups/opt_out.
>>>>>
>>>>
>>>>
--
---
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/groups/opt_out.