Hi,
You can create unique index for edges, if you would like to be sure that
you have only one relation for 2 vertexes you should disable lightweight
edges and create composite index for in and out fields of edge class.
So every time you will have duplication exception will be thrown and
transaction will be reverted.


On Thu, Mar 6, 2014 at 12:31 AM, TonyB <[email protected]> wrote:

> Is there a way to check if an edge already exists between two record ids?
>
> For example:
> create class Group extends V
> create class Contact extends V
> create class GroupContactEdge extends E
>
> // add a group document (#15:0)
> // add a contact document (#16:0)
>
> create edge GroupContactEdge from #15:0 to #16:0
>
> I'm not adding any properties so the GroupContactEdge class is empty, has
> no rows.
> So doing the following has no effect, returns 0 rows.
> select from GroupContactEdge
>
>
> If I run
> create edge GroupContactEdge from #15:0 to #16:0
> a second time it creates the edge again but I don't want it too.  I only
> want to allow a contact to be associated with a group once.
>
> In fact this even is screwing up OrientDB Studio.  When you browse into
> the object #15:0 it shows you 2 out edges on the side.  When you expand it,
> there is nothing listed, so you can't follow the edge to the next object.
>  Might be a bug?
>
> Thanks for any help,
> -Tony
>
>  --
>
> ---
> 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.
>



-- 
Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

-- 

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

Reply via email to