Show constraints

To list all constraints with the default output columns, use SHOW CONSTRAINTS. If all columns are required, use SHOW CONSTRAINTS YIELD *. For the full command syntax to list constraints, see Syntax → Show constraints. The constraints listed on this page are created on the page Create constraints.

All constraints created when setting a graph type will be returned by the SHOW CONSTRAINTS command. Similarly, all constraints created using the CREATE CONSTRAINT syntax will be returned by the SHOW CURRENT GRAPH TYPE command. For more information, see the following sections of the Show graph types page:

One of the output columns from SHOW CONSTRAINTS is the name of the constraint. This can be used to drop the constraint with the DROP CONSTRAINT command.

Listing constraints requires the SHOW CONSTRAINTS privilege.
Example 1. List all constraints with default output columns
Query
SHOW CONSTRAINTS
Result
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id | name                     | type                               | entityType     | labelsOrTypes  | properties                   | enforcedLabel | ownedIndex              | propertyType                     |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 28 | "actor_fullname"         | "NODE_KEY"                         | "NODE"         | ["Actor"]      | ["firstname", "surname"]     | NULL          | "actor_fullname"        | NULL                             |
| 27 | "author_name"            | "NODE_PROPERTY_EXISTENCE"          | "NODE"         | ["Author"]     | ["name"]                     | NULL          | NULL                    | NULL                             |
| 34 | "book_isbn"              | "NODE_PROPERTY_UNIQUENESS"         | "NODE"         | ["Book"]       | ["isbn"]                     | NULL          | "book_isbn"             | NULL                             |
| 23 | "book_title_year"        | "NODE_PROPERTY_UNIQUENESS"         | "NODE"         | ["Book"]       | ["title", "publicationYear"] | NULL          | "book_title_year"       | NULL                             |
| 36 | "director_imdbId"        | "NODE_KEY"                         | "NODE"         | ["Director"]   | ["imdbId"]                   | NULL          | "director_imdbId"       | NULL                             |
| 26 | "knows_since_how"        | "RELATIONSHIP_KEY"                 | "RELATIONSHIP" | ["KNOWS"]      | ["since", "how"]             | NULL          | "knows_since_how"       | NULL                             |
| 12 | "movie_tagline"          | "NODE_PROPERTY_TYPE"               | "NODE"         | ["Movie"]      | ["tagline"]                  | NULL          | NULL                    | "STRING | LIST<STRING NOT NULL>" |
| 33 | "movie_title"            | "NODE_PROPERTY_TYPE"               | "NODE"         | ["Movie"]      | ["title"]                    | NULL          | NULL                    | "STRING"                         |
| 17 | "node_uniqueness_param"  | "NODE_PROPERTY_UNIQUENESS"         | "NODE"         | ["Book"]       | ["prop1"]                    | NULL          | "node_uniqueness_param" | NULL                             |
| 2  | "node_vector_constraint" | "NODE_PROPERTY_TYPE"               | "NODE"         | ["Movie"]      | ["embedding"]                | NULL          | NULL                    | "VECTOR<INTEGER32 NOT NULL>(42)" |
| 38 | "ownershipId"            | "RELATIONSHIP_KEY"                 | "RELATIONSHIP" | ["OWNS"]       | ["ownershipId"]              | NULL          | "ownershipId"           | NULL                             |
| 41 | "part_of"                | "RELATIONSHIP_PROPERTY_TYPE"       | "RELATIONSHIP" | ["PART_OF"]    | ["order"]                    | NULL          | NULL                    | "INTEGER"                        |
| 39 | "part_of_tags"           | "RELATIONSHIP_PROPERTY_TYPE"       | "RELATIONSHIP" | ["PART_OF"]    | ["tags"]                     | NULL          | NULL                    | "STRING | LIST<STRING NOT NULL>" |
| 24 | "prequels"               | "RELATIONSHIP_PROPERTY_UNIQUENESS" | "RELATIONSHIP" | ["PREQUEL_OF"] | ["order", "author"]          | NULL          | "prequels"              | NULL                             |
| 30 | "rel_exist_param"        | "RELATIONSHIP_PROPERTY_EXISTENCE"  | "RELATIONSHIP" | ["WROTE"]      | ["published"]                | NULL          | NULL                    | NULL                             |
| 3  | "rel_vector_constraint"  | "RELATIONSHIP_PROPERTY_TYPE"       | "RELATIONSHIP" | ["CONTAINS"]   | ["embedding"]                | NULL          | NULL                    | "VECTOR<FLOAT32 NOT NULL>(1536)" |
| 19 | "sequels"                | "RELATIONSHIP_PROPERTY_UNIQUENESS" | "RELATIONSHIP" | ["SEQUEL_OF"]  | ["order"]                    | NULL          | "sequels"               | NULL                             |
| 14 | "wrote_year"             | "RELATIONSHIP_PROPERTY_EXISTENCE"  | "RELATIONSHIP" | ["WROTE"]      | ["year"]                     | NULL          | NULL                    | NULL                             |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Example 2. List all constraints with full details

To return the full details of the constraints on a database, use SHOW CONSTRAINTS YIELD *

List all constraints with YIELD *
SHOW CONSTRAINTS YIELD *
Result
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id | name                     | type                               | entityType     | labelsOrTypes  | properties                   | enforcedLabel | classification | ownedIndex              | propertyType                     | options           | createStatement                                                                                                                   |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 28 | "actor_fullname"         | "NODE_KEY"                         | "NODE"         | ["Actor"]      | ["firstname", "surname"]     | NULL          | "undesignated" | "actor_fullname"        | NULL                             | {indexConfig: {}} | "CREATE CONSTRAINT `actor_fullname` FOR (n:`Actor`) REQUIRE (n.`firstname`, n.`surname`) IS KEY"                                  |
| 27 | "author_name"            | "NODE_PROPERTY_EXISTENCE"          | "NODE"         | ["Author"]     | ["name"]                     | NULL          | "independent"  | NULL                    | NULL                             | NULL              | "CREATE CONSTRAINT `author_name` FOR (n:`Author`) REQUIRE (n.`name`) IS NOT NULL"                                                 |
| 34 | "book_isbn"              | "NODE_PROPERTY_UNIQUENESS"         | "NODE"         | ["Book"]       | ["isbn"]                     | NULL          | "undesignated" | "book_isbn"             | NULL                             | {indexConfig: {}} | "CREATE CONSTRAINT `book_isbn` FOR (n:`Book`) REQUIRE (n.`isbn`) IS UNIQUE"                                                       |
| 23 | "book_title_year"        | "NODE_PROPERTY_UNIQUENESS"         | "NODE"         | ["Book"]       | ["title", "publicationYear"] | NULL          | "undesignated" | "book_title_year"       | NULL                             | {indexConfig: {}} | "CREATE CONSTRAINT `book_title_year` FOR (n:`Book`) REQUIRE (n.`title`, n.`publicationYear`) IS UNIQUE"                           |
| 36 | "director_imdbId"        | "NODE_KEY"                         | "NODE"         | ["Director"]   | ["imdbId"]                   | NULL          | "undesignated" | "director_imdbId"       | NULL                             | {indexConfig: {}} | "CREATE CONSTRAINT `director_imdbId` FOR (n:`Director`) REQUIRE (n.`imdbId`) IS KEY"                                              |
| 26 | "knows_since_how"        | "RELATIONSHIP_KEY"                 | "RELATIONSHIP" | ["KNOWS"]      | ["since", "how"]             | NULL          | "undesignated" | "knows_since_how"       | NULL                             | {indexConfig: {}} | "CREATE CONSTRAINT `knows_since_how` FOR ()-[r:`KNOWS`]-() REQUIRE (r.`since`, r.`how`) IS KEY"                                   |
| 12 | "movie_tagline"          | "NODE_PROPERTY_TYPE"               | "NODE"         | ["Movie"]      | ["tagline"]                  | NULL          | "independent"  | NULL                    | "STRING | LIST<STRING NOT NULL>" | NULL              | "CREATE CONSTRAINT `movie_tagline` FOR (n:`Movie`) REQUIRE (n.`tagline`) IS :: STRING | LIST<STRING NOT NULL>"                    |
| 33 | "movie_title"            | "NODE_PROPERTY_TYPE"               | "NODE"         | ["Movie"]      | ["title"]                    | NULL          | "independent"  | NULL                    | "STRING"                         | NULL              | "CREATE CONSTRAINT `movie_title` FOR (n:`Movie`) REQUIRE (n.`title`) IS :: STRING"                                                |
| 17 | "node_uniqueness_param"  | "NODE_PROPERTY_UNIQUENESS"         | "NODE"         | ["Book"]       | ["prop1"]                    | NULL          | "undesignated" | "node_uniqueness_param" | NULL                             | {indexConfig: {}} | "CREATE CONSTRAINT `node_uniqueness_param` FOR (n:`Book`) REQUIRE (n.`prop1`) IS UNIQUE"                                          |
| 2  | "node_vector_constraint" | "NODE_PROPERTY_TYPE"               | "NODE"         | ["Movie"]      | ["embedding"]                | NULL          | "independent"  | NULL                    | "VECTOR<INTEGER32 NOT NULL>(42)" | NULL              | "CREATE CONSTRAINT `node_vector_constraint` FOR (n:`Movie`) REQUIRE (n.`embedding`) IS :: VECTOR<INTEGER32 NOT NULL>(42)"         |
| 38 | "ownershipId"            | "RELATIONSHIP_KEY"                 | "RELATIONSHIP" | ["OWNS"]       | ["ownershipId"]              | NULL          | "undesignated" | "ownershipId"           | NULL                             | {indexConfig: {}} | "CREATE CONSTRAINT `ownershipId` FOR ()-[r:`OWNS`]-() REQUIRE (r.`ownershipId`) IS KEY"                                           |
| 41 | "part_of"                | "RELATIONSHIP_PROPERTY_TYPE"       | "RELATIONSHIP" | ["PART_OF"]    | ["order"]                    | NULL          | "independent"  | NULL                    | "INTEGER"                        | NULL              | "CREATE CONSTRAINT `part_of` FOR ()-[r:`PART_OF`]-() REQUIRE (r.`order`) IS :: INTEGER"                                           |
| 39 | "part_of_tags"           | "RELATIONSHIP_PROPERTY_TYPE"       | "RELATIONSHIP" | ["PART_OF"]    | ["tags"]                     | NULL          | "independent"  | NULL                    | "STRING | LIST<STRING NOT NULL>" | NULL              | "CREATE CONSTRAINT `part_of_tags` FOR ()-[r:`PART_OF`]-() REQUIRE (r.`tags`) IS :: STRING | LIST<STRING NOT NULL>"                |
| 24 | "prequels"               | "RELATIONSHIP_PROPERTY_UNIQUENESS" | "RELATIONSHIP" | ["PREQUEL_OF"] | ["order", "author"]          | NULL          | "undesignated" | "prequels"              | NULL                             | {indexConfig: {}} | "CREATE CONSTRAINT `prequels` FOR ()-[r:`PREQUEL_OF`]-() REQUIRE (r.`order`, r.`author`) IS UNIQUE"                               |
| 30 | "rel_exist_param"        | "RELATIONSHIP_PROPERTY_EXISTENCE"  | "RELATIONSHIP" | ["WROTE"]      | ["published"]                | NULL          | "independent"  | NULL                    | NULL                             | NULL              | "CREATE CONSTRAINT `rel_exist_param` FOR ()-[r:`WROTE`]-() REQUIRE (r.`published`) IS NOT NULL"                                   |
| 3  | "rel_vector_constraint"  | "RELATIONSHIP_PROPERTY_TYPE"       | "RELATIONSHIP" | ["CONTAINS"]   | ["embedding"]                | NULL          | "independent"  | NULL                    | "VECTOR<FLOAT32 NOT NULL>(1536)" | NULL              | "CREATE CONSTRAINT `rel_vector_constraint` FOR ()-[r:`CONTAINS`]-() REQUIRE (r.`embedding`) IS :: VECTOR<FLOAT32 NOT NULL>(1536)" |
| 19 | "sequels"                | "RELATIONSHIP_PROPERTY_UNIQUENESS" | "RELATIONSHIP" | ["SEQUEL_OF"]  | ["order"]                    | NULL          | "undesignated" | "sequels"               | NULL                             | {indexConfig: {}} | "CREATE CONSTRAINT `sequels` FOR ()-[r:`SEQUEL_OF`]-() REQUIRE (r.`order`) IS UNIQUE"                                             |
| 14 | "wrote_year"             | "RELATIONSHIP_PROPERTY_EXISTENCE"  | "RELATIONSHIP" | ["WROTE"]      | ["year"]                     | NULL          | "independent"  | NULL                    | NULL                             | NULL              | "CREATE CONSTRAINT `wrote_year` FOR ()-[r:`WROTE`]-() REQUIRE (r.`year`) IS NOT NULL"                                             |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Listing constraints with filtering

The SHOW CONSTRAINTS command can be filtered in various ways. The filtering of rows can be done using constraint type keywords or a WHERE clause, while filtering of columns is achieved by specifying the desired columns in a YIELD clause.

Example 3. List only specific constraint types
List only key constraints
SHOW KEY CONSTRAINTS
Result
+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id | name              | type               | entityType     | labelsOrTypes | properties               | enforcedLabel | ownedIndex        | propertyType |
+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 28 | "actor_fullname"  | "NODE_KEY"         | "NODE"         | ["Actor"]     | ["firstname", "surname"] | NULL          | "actor_fullname"  | NULL         |
| 36 | "director_imdbId" | "NODE_KEY"         | "NODE"         | ["Director"]  | ["imdbId"]               | NULL          | "director_imdbId" | NULL         |
| 26 | "knows_since_how" | "RELATIONSHIP_KEY" | "RELATIONSHIP" | ["KNOWS"]     | ["since", "how"]         | NULL          | "knows_since_how" | NULL         |
| 38 | "ownershipId"     | "RELATIONSHIP_KEY" | "RELATIONSHIP" | ["OWNS"]      | ["ownershipId"]          | NULL          | "ownershipId"     | NULL         |
+------------------------------------------------------------------------------------------------------------------------------------------------------------+

For a full list of all the constraint types (and synonyms) available in this command see Syntax → SHOW CONSTRAINTS.

Example 4. Filtering constraints using the WHERE clause
List only constraints with a RELATIONSHIP entityType
SHOW CONSTRAINTS
WHERE entityType = 'RELATIONSHIP'
Result
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id | name                    | type                               | entityType     | labelsOrTypes  | properties          | enforcedLabel | ownedIndex        | propertyType                     |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 26 | "knows_since_how"       | "RELATIONSHIP_KEY"                 | "RELATIONSHIP" | ["KNOWS"]      | ["since", "how"]    | NULL          | "knows_since_how" | NULL                             |
| 38 | "ownershipId"           | "RELATIONSHIP_KEY"                 | "RELATIONSHIP" | ["OWNS"]       | ["ownershipId"]     | NULL          | "ownershipId"     | NULL                             |
| 41 | "part_of"               | "RELATIONSHIP_PROPERTY_TYPE"       | "RELATIONSHIP" | ["PART_OF"]    | ["order"]           | NULL          | NULL              | "INTEGER"                        |
| 39 | "part_of_tags"          | "RELATIONSHIP_PROPERTY_TYPE"       | "RELATIONSHIP" | ["PART_OF"]    | ["tags"]            | NULL          | NULL              | "STRING | LIST<STRING NOT NULL>" |
| 24 | "prequels"              | "RELATIONSHIP_PROPERTY_UNIQUENESS" | "RELATIONSHIP" | ["PREQUEL_OF"] | ["order", "author"] | NULL          | "prequels"        | NULL                             |
| 30 | "rel_exist_param"       | "RELATIONSHIP_PROPERTY_EXISTENCE"  | "RELATIONSHIP" | ["WROTE"]      | ["published"]       | NULL          | NULL              | NULL                             |
| 3  | "rel_vector_constraint" | "RELATIONSHIP_PROPERTY_TYPE"       | "RELATIONSHIP" | ["CONTAINS"]   | ["embedding"]       | NULL          | NULL              | "VECTOR<FLOAT32 NOT NULL>(1536)" |
| 19 | "sequels"               | "RELATIONSHIP_PROPERTY_UNIQUENESS" | "RELATIONSHIP" | ["SEQUEL_OF"]  | ["order"]           | NULL          | "sequels"         | NULL                             |
| 14 | "wrote_year"            | "RELATIONSHIP_PROPERTY_EXISTENCE"  | "RELATIONSHIP" | ["WROTE"]      | ["year"]            | NULL          | NULL              | NULL                             |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Example 5. Returning specific columns for all constraints

It is possible to return only specific columns of the available constraints using the YIELD clause:

List only the name, type, and createStatement columns
SHOW CONSTRAINTS
YIELD name, type, createStatement
Result
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| name                     | type                               | createStatement                                                                                                                   |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| "actor_fullname"         | "NODE_KEY"                         | "CREATE CONSTRAINT `actor_fullname` FOR (n:`Actor`) REQUIRE (n.`firstname`, n.`surname`) IS KEY"                                  |
| "author_name"            | "NODE_PROPERTY_EXISTENCE"          | "CREATE CONSTRAINT `author_name` FOR (n:`Author`) REQUIRE (n.`name`) IS NOT NULL"                                                 |
| "book_isbn"              | "NODE_PROPERTY_UNIQUENESS"         | "CREATE CONSTRAINT `book_isbn` FOR (n:`Book`) REQUIRE (n.`isbn`) IS UNIQUE"                                                       |
| "book_title_year"        | "NODE_PROPERTY_UNIQUENESS"         | "CREATE CONSTRAINT `book_title_year` FOR (n:`Book`) REQUIRE (n.`title`, n.`publicationYear`) IS UNIQUE"                           |
| "director_imdbId"        | "NODE_KEY"                         | "CREATE CONSTRAINT `director_imdbId` FOR (n:`Director`) REQUIRE (n.`imdbId`) IS KEY"                                              |
| "knows_since_how"        | "RELATIONSHIP_KEY"                 | "CREATE CONSTRAINT `knows_since_how` FOR ()-[r:`KNOWS`]-() REQUIRE (r.`since`, r.`how`) IS KEY"                                   |
| "movie_tagline"          | "NODE_PROPERTY_TYPE"               | "CREATE CONSTRAINT `movie_tagline` FOR (n:`Movie`) REQUIRE (n.`tagline`) IS :: STRING | LIST<STRING NOT NULL>"                    |
| "movie_title"            | "NODE_PROPERTY_TYPE"               | "CREATE CONSTRAINT `movie_title` FOR (n:`Movie`) REQUIRE (n.`title`) IS :: STRING"                                                |
| "node_uniqueness_param"  | "NODE_PROPERTY_UNIQUENESS"         | "CREATE CONSTRAINT `node_uniqueness_param` FOR (n:`Book`) REQUIRE (n.`prop1`) IS UNIQUE"                                          |
| "node_vector_constraint" | "NODE_PROPERTY_TYPE"               | "CREATE CONSTRAINT `node_vector_constraint` FOR (n:`Movie`) REQUIRE (n.`embedding`) IS :: VECTOR<INTEGER32 NOT NULL>(42)"         |
| "ownershipId"            | "RELATIONSHIP_KEY"                 | "CREATE CONSTRAINT `ownershipId` FOR ()-[r:`OWNS`]-() REQUIRE (r.`ownershipId`) IS KEY"                                           |
| "part_of"                | "RELATIONSHIP_PROPERTY_TYPE"       | "CREATE CONSTRAINT `part_of` FOR ()-[r:`PART_OF`]-() REQUIRE (r.`order`) IS :: INTEGER"                                           |
| "part_of_tags"           | "RELATIONSHIP_PROPERTY_TYPE"       | "CREATE CONSTRAINT `part_of_tags` FOR ()-[r:`PART_OF`]-() REQUIRE (r.`tags`) IS :: STRING | LIST<STRING NOT NULL>"                |
| "prequels"               | "RELATIONSHIP_PROPERTY_UNIQUENESS" | "CREATE CONSTRAINT `prequels` FOR ()-[r:`PREQUEL_OF`]-() REQUIRE (r.`order`, r.`author`) IS UNIQUE"                               |
| "rel_exist_param"        | "RELATIONSHIP_PROPERTY_EXISTENCE"  | "CREATE CONSTRAINT `rel_exist_param` FOR ()-[r:`WROTE`]-() REQUIRE (r.`published`) IS NOT NULL"                                   |
| "rel_vector_constraint"  | "RELATIONSHIP_PROPERTY_TYPE"       | "CREATE CONSTRAINT `rel_vector_constraint` FOR ()-[r:`CONTAINS`]-() REQUIRE (r.`embedding`) IS :: VECTOR<FLOAT32 NOT NULL>(1536)" |
| "sequels"                | "RELATIONSHIP_PROPERTY_UNIQUENESS" | "CREATE CONSTRAINT `sequels` FOR ()-[r:`SEQUEL_OF`]-() REQUIRE (r.`order`) IS UNIQUE"                                             |
| "wrote_year"             | "RELATIONSHIP_PROPERTY_EXISTENCE"  | "CREATE CONSTRAINT `wrote_year` FOR ()-[r:`WROTE`]-() REQUIRE (r.`year`) IS NOT NULL"                                             |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Result columns for listing constraints

Listing constraints output
Column Description Type

id

The id of the constraint. Default Output

INTEGER

name

Name of the constraint (explicitly set by the user or automatically assigned). Default Output

STRING

type

The ConstraintType of this constraint (NODE_PROPERTY_UNIQUENESS, RELATIONSHIP_PROPERTY_UNIQUENESS, NODE_PROPERTY_EXISTENCE, RELATIONSHIP_PROPERTY_EXISTENCE, NODE_PROPERTY_TYPE, RELATIONSHIP_PROPERTY_TYPE, NODE_LABEL_EXISTENCE, RELATIONSHIP_SOURCE_LABEL, RELATIONSHIP_TARGET_LABEL, NODE_KEY, or RELATIONSHIP_KEY). Default Output

STRING

entityType

Type of entities this constraint represents (NODE or RELATIONSHIP). Default Output

STRING

labelsOrTypes

The labels or relationship types of this constraint. The list returned will only include a single value (the name of the constrained node label or relationship type). Default Output

LIST<STRING>

properties

The properties of this constraint, or null for node label existence, relationship source label, and relationship target constraints which do not constrain properties. Default Output

LIST<STRING>

enforcedLabel

The implied labels required by a node label existence constraint or the source node and target node labels required by a relationship source or target label constraint, or null for other constraints which do not constrain labels. Default Output Cypher 25 only Introduced in Neo4j 2026.02

STRING

ownedIndex

The name of the index associated with the constraint or null, in case no index is associated with it. Default Output

STRING

propertyType

The property type the property is restricted to for property type constraints, or null for the other constraints. Default Output

STRING

classification

The status of a constraint in a graph type (dependent, undesignated, or independent). Cypher 25 only Introduced in Neo4j 2026.02

STRING

options

The options passed to CREATE command, for the index associated to the constraint, or null if no index is associated with the constraint.

MAP

createStatement

Statement used to create the constraint, or null if the constraint cannot be created through CREATE CONSTRAINT (for example in case of version incompatibilities or for constraints with dependent classification).

STRING