|| apoc.schema.relationship.constraintExists - APOC 核心文档 - Neo4j 文档

apoc.schema.relationship.constraintExists

详情

语法

apoc.schema.relationship.constraintExists(type, propertyName)

描述

返回一个 BOOLEAN 值,表示给定 RELATIONSHIP 类型是否存在具有给定属性名称的约束。

参数

名称

类型

描述

type

STRING

要检查约束的关系类型。

propertyName

LIST<STRING>

要检查约束的属性名称。

返回

BOOLEAN

此函数不适合从多个线程运行。因此,并行运行时不支持此函数。更多信息请参阅Cypher 手册 → 并行运行时

使用示例

本节中的示例基于已应用以下约束的数据库

CREATE CONSTRAINT likesDay
FOR ()-[like:LIKED]-()
REQUIRE (like.day) IS NOT NULL;
RETURN apoc.schema.relationship.constraintExists("LIKED", ["day"]) AS output;
结果
输出

TRUE

© . This site is unofficial and not affiliated with Neo4j, Inc.