Here is the solution: 

http://stackoverflow.com/questions/10735203/does-anyone-have-a-working-example-of-json-insert-select-in-orientdb/29093705#29093705

Please check. 

On Thursday, February 20, 2014 at 6:07:57 PM UTC-8, Shishya wrote:
>
> Hi Luca,
>>
>
> JSON fields come as an object and even toArray() function converts it to 
> some object only.
>
> I have this json in a field and seclection/conversion is doing a flip/flop 
> of formats which is making me crazy
> So First query gives this
> var c = db.command("sql","select from mynode");
> var cit = c[0].getRecord().field('field1');
> cit >Result:
> [{"@type":"d","@version":0,"value":[{"kind":"A","fb":"found","inme":
> "Kato1","id":"4497057"},{"kind":"A","fb":"found","inme":"Kato2","id":
> "4497067"},{"kind":"A","fb":"found","inme":"Kato3","id":"4497037"}]}]
>
>
> var cit1 = c[0].getRecord().field('field1').toArray();
> cit1 or cit1[0]>Result:
> [{"@type":"d","@version":0,"value":[{"kind":"A","fb":"found","inme":"Kato"
> ,"id":"4497057"}]}]
>
> Now the craziest part. I have to access the field values.
> cit[0].kind returns null
> cit[0] gives error
> cit[0]+'' returns this
> [{"@type":"d","@version":0,"value":[{"kind"="A","fb"="found","inme"="Kato"
> ,"id"="4497057"}]}]
>
> I am using 1.7rc2.SNAPSHOT and same results in 1.7rc1
>
>
>
> 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/d/optout.

Reply via email to