如何使用 Spring 为 Neo4J 数据库中的标签添加唯一约束?
我正在尝试在 Kotlin 或 Java Spring 中创建节点属性的唯一约束。
如何触发或设置与此密码等效的约束 询问:
CREATE CONSTRAINT constraint_name IF NOT EXISTS FOR (book:Book) REQUIRE book.isbn IS UNIQUE
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Spring Data Neo4j 6+ 不再允许创建约束和索引。我们确信与数据库相关的模式操作不应该由对象[图/某物]映射器负责。
为了填补这一空白,我们创建了 Neo4j-Migrations。它甚至不提供更多功能,但有助于将 DBA 操作和映射的关注点分开。
Spring Data Neo4j 6+ does not allow 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.