'How to add a unique constraint for a label in a Neo4J database using Spring?
I am trying to create a Unique Constraint of a Node's property in Kotlin or Java Spring.
How do I trigger or set up a constraint equivalent to this cypher query:
CREATE CONSTRAINT constraint_name IF NOT EXISTS FOR (book:Book) REQUIRE book.isbn IS UNIQUE
Solution 1:[1]
Spring Data Neo4j 6+ does not the creation of constraints and indexes anymore. We are convinced that database related schema operations should not be in the responsible of an object [graph/something] mapper. To fill this gap, we created Neo4j-Migrations. It does not even provide more functionality but also helps to keep the concerns of DBA operations and mapping separated.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | meistermeier |
