Hi,

You definitely can have an embedded document (or vertex) and a link inside 
a Vertex.  A Vertex (which is really an OrientVertex object) uses a 
Document at a lower level.  So, it may use all the same property types.

This is how to add an embedded document to an embeddedset.

Let's say I have this schema:

```

create class TestV extends V

create property TestV.Name String

create property TestV.MySet EmbeddedSet
```

Now, I'll create one instance:
```
insert into TestV set Name = "Example 1";
```

To add an embedded document to the set, MySet, in SQL do this:
```

update TestV add MySet = [ {"@type":"d", "Name":"Apple", "Color":"Red"}] 
where Name = "Example 1"

update TestV add MySet = [ {"@type":"d", "Name":"Orange", 
"Color":"Orange"}] where Name = "Example 1"
```
Notice the [ ] around the JSON object data.  

To see the results:
```
select expand(MySet) from TestV where Name = "Example 1"
```

Hope that helps!

-Colin

Orient Technologies

The Company behind OrientDB










On Sunday, March 8, 2015 at 8:08:14 AM UTC-5, Di Da wrote:
>
> I can't seems to find a thorough documentation about EMBEDDED types. 
>
> I need to know how to add an object like this :
>
> { name : "myname", url : "myurl" } into an EMBEDDEDSET
>
> using SQL.
>
> My second question is that is it allowed to have EMBEDDED and LINK in a 
> Vertex?
>
>

-- 

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