I'll strongly +1 that having a concept of "unique" index values should be
built into Neo4j. It's just too common of a requirement.

Aseem

On Thu, Jul 7, 2011 at 11:48 AM, etc3 <e...@nextideapartners.com> wrote:

> I'm new to this framework, is there an example that demonstrates removing a
> non-existent property and how it would be used in this context?
>
> Thanks
>
> -----Original Message-----
> From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org]
> On
> Behalf Of Chris Gioran
> Sent: Thursday, July 07, 2011 11:04 AM
> To: Neo4j user discussions
> Subject: Re: [Neo4j] Unique Constaint on Index
>
> Hi,
>
> the ability to acquire locks cluster-wide exists, albeit in an ad hoc
> fashion. Grabbing a write lock on the node you want to ensure is uniquely
> indexed will ensure that the operations are serialized across all cluster
> members.
> The most simple way to get that lock currently is the (somewhat hackish but
> entirely correct) removal of a non-existing property.
>
> cheers,
> CG
>
> On Thu, Jul 7, 2011 at 5:53 PM, etc3 <e...@nextideapartners.com> wrote:
> > How do I ensure another request is not performing the same operation
> > on another node in the cluster?
> >
> >
> > -----Original Message-----
> > From: user-boun...@lists.neo4j.org
> > [mailto:user-boun...@lists.neo4j.org] On Behalf Of Marko Rodriguez
> > Sent: Thursday, July 07, 2011 10:35 AM
> > To: Neo4j user discussions
> > Subject: Re: [Neo4j] Unique Constaint on Index
> >
> > Hi,
> >
> >> We are testing Neo4J and need to support unique emails across all
> >> users. Is this possible with the current API?
> >
> > You can add such a constraint when updating the indices:
> >
> > if(index.get('email', address).hasNext()) {
> >  throw new RuntimeException("There are two nodes that share the same
> > email address."); } else {
> >  index.put('email', address, node);
> > }
> >
> > Marko.
> >
> > http://markorodriguez.com
> > _______________________________________________
> > Neo4j mailing list
> > User@lists.neo4j.org
> > https://lists.neo4j.org/mailman/listinfo/user
> >
> > _______________________________________________
> > Neo4j mailing list
> > User@lists.neo4j.org
> > https://lists.neo4j.org/mailman/listinfo/user
> >
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to