apoc.schema.node.constraintExists
Syntax |
|
||
Description |
Returns a |
||
Arguments |
Name |
Type |
Description |
|
|
The node label to check for a constraint on. |
|
|
|
The property names to check for a constraint on. |
|
Returns |
|
This function is not considered safe to run from multiple threads. It is therefore not supported by the parallel runtime (introduced in Neo4j 5.13). For more information, see the Cypher Manual → Parallel runtime. |
Usage Examples
The examples in this section are based on a database that has applied the following constraints:
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;
output |
---|
TRUE |
RETURN apoc.schema.node.constraintExists("Person", ["name", "id"]) AS output;
output |
---|
FALSE |