Required arguments
key
key
is key name for the graph.
constraintType
constraintType
is the constraint type: either
MANDATORY or UNIQUE.NODE label | RELATIONSHIP reltype
NODE label | RELATIONSHIP reltype
is the graph entity type (
NODE or RELATIONSHIP) and the name of the node label or relationship type on which the constraint is enforced.propCount
propCount
is the number of properties following. Valid values are between 1 and 255.
prop...
prop...
is a list of
propCount property names.Return value
@simple-string-reply -OK if executed correctly, or @error-reply otherwise.
Examples
To delete a unique constraint for all nodes with labelPerson enforcing uniqueness on the combination of values of attributes first_name and last_name, issue the following command:
Frequently Asked Questions
Is dropping a constraint synchronous or asynchronous?
Is dropping a constraint synchronous or asynchronous?
Unlike constraint creation, dropping a constraint is synchronous. The command returns
OK immediately upon successful removal.Do I need to drop the supporting index after dropping a unique constraint?
Do I need to drop the supporting index after dropping a unique constraint?
No, the supporting index is not automatically removed. You can drop it separately if it is no longer needed, but it may still be useful for query performance.
What happens if I try to drop a constraint that does not exist?
What happens if I try to drop a constraint that does not exist?
The command will return an error indicating that the specified constraint was not found.
Does dropping a constraint affect existing data?
Does dropping a constraint affect existing data?
No. Dropping a constraint only removes the enforcement rule. Existing data remains unchanged; it simply will no longer be validated against that constraint.