cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Unique index for a child node

I have this relationship
Node1 ---- HAS ----> Node2

I want to make sure that the "name" property in Node2 is unique within it's parent node - Node1.

Is it possible to enforce that using Neo4J-OGM?
Or do I have to make a separate get call before calling save?

Thank you.

1 ACCEPTED SOLUTION

No, this is not possible within Neo4j-OGM. But it is also not possible to do this in Neo4j.
You would have to enforce the rule by calling a query upfront the persistence to know about the potential existence of another node with the same name in the sub-group.

View solution in original post

1 REPLY 1

No, this is not possible within Neo4j-OGM. But it is also not possible to do this in Neo4j.
You would have to enforce the rule by calling a query upfront the persistence to know about the potential existence of another node with the same name in the sub-group.