Hi Munish, If this is the domain: User -(Rate)-> Article
You could create a unique index agains the edge with the composite key against Rate (in, out). Or you could assign a constraint to the edge property to be a LINK and not a COLLECTION. Example: CREATE PROPERTY User.outRate LINK Rate Let me know if works, the second solution is the lighter and faster. Lvc@ On 14 April 2014 14:29, Munish Chopra <[email protected]> wrote: > Hi, > > I want to restrict number of edges between two vertexes to one. > > I have a scenario where I have a User vertex and Article vertex. When a > user rate an article, we are making an edge from user to article. > > Now, I don't want users to rate article more than once. How can I make > sure there is exactly one edge between two vertexes. > > I am using orientdb SQL queries. Is their a way I can achieve my goal with > SQL? > > Thanks, > Munish > > -- > > --- > 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. > -- --- 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.
