As far as I understand, Embedded type allows us to keep a document within 
the containing/parent document. The contained document itself doesn't have 
its identity but it has to have a specific structure (don't think it can be 
any JSON object). For instance if I wanted to keep address as an embedded 
object with the Person class, the address object will look like this:

{'@type' : 'd', '@class':'Address' ,'street' : 'One North Place', 'street2' 
: '88 Queensway', 'city' : 'Admiralty', 'zip' : '02109', 'country' : 'Hong 
Kong'}


As you can imagine, Embedded list will be a list of similar object.

hope this helps.
 

On Tuesday, 23 September 2014 06:04:55 UTC+8, Jason MacDonald wrote:
>
> Hi,
>
> I'm trying to wrap my head around embedding a JSON object in a field and 
> the docs really aren't clear on the differences between the 4 types 
> (EMBEDDED, EMBEDDED_LIST, EMBEDDED_MAP and EMBEDDED_SET) and how exactly 
> they are used. I've tried a number of different combinations through the 
> included STUDIO app and can't get a simple {"name": "test"} object to save. 
> To make matters worse, there's type, link_type and link_class that are only 
> adding to my confusion. Is there some combination of these schema fields 
> that need to be set? I really can't make heads or takes of how I should go 
> about storing a simple JSON object and would really appreciate it if 
> someone could provide some simple examples. 
>
> Thanks!
>
> P.S. I did see one example using some @type: "d" thing but I couldn't find 
> any explanation about why that was there - nor do I want extra fields 
> polluting my JSON model that the front-end is expecting.
>

-- 

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