apoc.schema.node.constraintExists
语法 |
|
||
描述 |
根据给定 |
||
参数 |
名称 |
类型 |
描述 |
|
|
要检查约束的节点标签。 |
|
|
|
要检查约束的属性名称。 |
|
返回 |
|
||
|
此函数不被认为是线程安全的,因此并行运行时不支持它。更多信息请参见Cypher 手册 → 并行运行时。 |
使用示例
本节中的示例基于已应用以下约束的数据库
CREATE CONSTRAINT personName FOR (person:Person)
REQUIRE person.name IS UNIQUE;
CREATE CONSTRAINT userId FOR (user:User)
REQUIRE user.id IS UNIQUE;
RETURN apoc.schema.node.constraintExists("Person", ["name"]) AS output;
| 输出 |
|---|
TRUE |
RETURN apoc.schema.node.constraintExists("Person", ["name", "id"]) AS output;
| 输出 |
|---|
FALSE |