Constraints
Neo4j offers several constraints to ensure the quality and integrity of data in a graph. The following constraints are available in Neo4j:
-
Property uniqueness constraints ensure that the combined property values are unique for all nodes with a specific label or all relationships with a specific type.
-
Property existence constraints ensure that a property exists either for all nodes with a specific label or for all relationships with a specific type. Enterprise Edition
-
Property type constraints ensure that a property has the required property type for all nodes with a specific label or for all relationships with a specific type. Introduced in 5.9 Enterprise Edition
-
Key constraints ensure that all properties exist and that the combined property values are unique for all nodes with a specific label or all relationships with a specific type.Enterprise Edition
To learn more about creating, listing, and dropping these constraints, as well as information about index-backed constraints, constraint creation failures and data violation scenarios, and more, see Create, show, and drop constraints.
For reference material about the Cypher® commands used to manage constraints, see Syntax.