Hi Luca,
I have the same issue.
I would like to insert into orientdb a json with a complex syntax.
This is a json example :
{
"person" : {
"name" : "fabio",
"surname" : "benigni",
"address" : { "street" : "colombo", "number" : "1", "city" : "Rome"},
"vehicles" : [{
"vehicle" : {"type" : "car", "brand":"VW", "model":"Polo"},
"vehicle" : {"type" : "car", "brand":"VW","model" : "Passat"},
"vehicle" : {"type" : "motorbike", "brand":"Ducati","model" : "Monster 620
ie Dark"},
}],
}
}
Using
create vertex Person content {...}
or
INSERT INTO PERSON content {...}
I achieve the same result.
The json object is inserted as is in a "person" attribute in the Person
vertex.
Otherwise if I remove the "person" from the json syntax I have the vertex
inserted with all the attributes that are at the root level,
name and surname, but attributes address and vehicles has the sub-json
object as content.
How I have to modify the structure of the Json to insert the attribute
"@type" : "d" .
I'm trying to use SQL through OrientDB Studio webb app with
orientdb-community-1.7.
Thank you for your help.
I hope that this example could be useful for the community
Fabio
Il giorno lunedì 28 gennaio 2013 00:25:18 UTC+1, Lvc@ ha scritto:
>
> Hi Stefan,
> are you referring to "info" attribute? Since in JSON there isn't
> difference between a document (object) and a map using OrientDB you've to
> specify the attribute "@type" : "d" that tells to OrientDB that's an
> embedded document.
>
> Lvc@
>
>
> On 27 January 2013 19:53, Stefán <[email protected] <javascript:>> wrote:
>
>> Hi,
>>
>> I have a nested structure in JSON {"info":{"some":"things","are":true}}
>> which I'm storing as a document property.
>> Should I store it in a "Embedded map" or is there a better way?
>>
>> Regards,
>> -Stefan
>>
>> --
>>
>>
>>
>>
>
>
--
---
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.