I have created a neo4j DB locally and assigned some indices and unique 
constraint.

Here is the :schema

Indexes
  ON :Actor(social_id) ONLINE (for uniqueness constraint) 
  ON :Category(name)   ONLINE (for uniqueness constraint) 

Constraints
  ON (actor:Actor) ASSERT actor.social_id IS UNIQUE
  ON (category:Category) ASSERT category.name IS UNIQUE

Additionally I do a createIfNotFound() in my java code, where I first do a 
find and then create if not found.

Inspite of these two checks I still see multiple nodes of Label category 
and same name existing in the DB.

 MATCH (n:Category) WHERE n.name='garden' RETURN n

name    garden
name    garden
name    garden
name    garden
Returned 4 rows in 49 ms.

I am not sure what I am missing, and why is the unique constraint not being 
honored.


Would appreciate any pointers to debug.


Thanks

Varun

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" 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