apoc.schema.relationship.constraintExists

Function

apoc.schema.relationship.constraintExists(type String, propertyName [String]) - returns a boolean depending on whether or not a constraint exists for the given relationship type with the given property names.

Signature

apoc.schema.relationship.constraintExists(type :: STRING?, propertyName :: LIST? OF STRING?) :: (BOOLEAN?)

Input parameters

Name Type Default

type

STRING?

null

propertyName

LIST? OF STRING?

null

Usage Examples

The examples in this section are based on a database that has applied the following constraints:

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

TRUE