From 5c8da1d4843217eab0aa5eee385bdd0cde5068ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20Pryce-=C3=85klundh?= <112686610+JPryce-Aklundh@users.noreply.github.com> Date: Mon, 23 Sep 2024 10:08:51 +0200 Subject: [PATCH] more cleanup --- modules/ROOT/pages/constraints/index.adoc | 2 +- .../ROOT/pages/constraints/managing-constraints.adoc | 11 ++++++++--- modules/ROOT/pages/constraints/syntax.adoc | 11 +++++++---- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/modules/ROOT/pages/constraints/index.adoc b/modules/ROOT/pages/constraints/index.adoc index 9b08e0f3f..e80284c35 100644 --- a/modules/ROOT/pages/constraints/index.adoc +++ b/modules/ROOT/pages/constraints/index.adoc @@ -11,7 +11,7 @@ label: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. label:enterprise-edition[] * *Key constraints* ensure that property values are unique and exists for all nodes with a specific label or all relationships with a specific type. label:enterprise-edition[] -To learn more about creating, listing, and dropping these constraints, as well as information about index-backed constraints, sonstraint creation failures and data violation scenarios, and more, see xref:constraints/managing-constraints.adoc[]. +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 xref:constraints/managing-constraints.adoc[]. For reference material about the Cypher commands used to manage constraints, see xref:constraints/syntax.adoc[]. diff --git a/modules/ROOT/pages/constraints/managing-constraints.adoc b/modules/ROOT/pages/constraints/managing-constraints.adoc index 651bf44c1..83d112a17 100644 --- a/modules/ROOT/pages/constraints/managing-constraints.adoc +++ b/modules/ROOT/pages/constraints/managing-constraints.adoc @@ -48,7 +48,7 @@ Single property uniqueness constraints are created with the following commands: * Relationship property uniqueness constraints: `CREATE CONSTRAINT constraint_name FOR ()-[r:REL_TYPE]-() REQUIRE r.property IS UNIQUE`. -For the full command syntax to create a uniqueness constraint, see xref:constraints/syntax.adoc#create-property-uniqueness-constraints[Syntax -> Create property uniqueness constraint]. +For the full command syntax to create a uniqueness constraint, see xref:constraints/syntax.adoc#create-property-uniqueness-constraints[Syntax -> Create property uniqueness constraints]. .Create a node property uniqueness constraint on a single property ====== @@ -561,6 +561,8 @@ FOR (n:Label) REQUIRE (n.propertyName_1, ..., n.propertyName_n) NODE KEY`. * Relationship key constraints: `CREATE CONSTRAINT constraint_name FOR ()-[r:REL_TYPE]-() REQUIRE (r.propertyName_1, ..., r.propertyName_n) IS RELATIONSHIP KEY`. +For the full command syntax to create a key constraint, see xref:constraints/syntax.adoc#create-key-constraints[Syntax -> Create key constraints]. + .Create a composite node key constraint on multiple properties ====== @@ -712,7 +714,7 @@ Single property constraints will create single property indexes and multiple pro [NOTE] Indexes of the same index type, label/relationship type, and property combination cannot be added separately. -However, dropping a key or uniqueness constraint will also drop its backing index. +However, dropping a property uniqueness or key constraint will also drop its backing index. If the backing index is still required, the index needs to be explicitly re-created. Property uniqueness and key constraints require an index because it allows the system to quickly check if a node with the same label and property value or a relationship with the same type and property value already exists. @@ -1256,6 +1258,7 @@ Constraint( id=10, name='preExisting_actor_name_age', type='UNIQUENESS', schema= 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 xref:constraints/syntax.adoc#list-constraints[Syntax -> SHOW CONSTRAINTS]. One of the output columns from `SHOW CONSTRAINTS` is the name of the constraint. This can be used to drop the constraint with the xref::constraints/syntax.adoc#constraints-syntax-drop[`DROP CONSTRAINT` command]. @@ -1381,7 +1384,7 @@ SHOW KEY CONSTRAINTS +--------------------------------------------------------------------------------------------------------------------------------------------------------------+ ---- -For a full list of all the constraint types (and synonyms) available in this command see xref:constraints/syntax.adoc#constraints-syntax-list[syntax for listing constraints]. +For a full list of all the constraint types (and synonyms) available in this command see xref:constraints/syntax.adoc#list-constraints[Syntax -> SHOW CONSTRAINTS]. ====== @@ -1460,6 +1463,7 @@ WHERE entityType = 'RELATIONSHIP' ====== + [[list-constraints-result-columns]] === Result columns for listing constraints @@ -1515,6 +1519,7 @@ label:default-output[] label:new[Introduced in 5.9] == DROP CONSTRAINT Constraints are dropped using the `DROP CONSTRAINT` command. +For the full command syntax to drop constraints, see xref:constraints/syntax.adoc#drop-constraint[Syntax -> DROP CONSTRAINT]. [NOTE] Dropping a constraint requires the link:{neo4j-docs-base-uri}/operations-manual/{page-version}/authentication-authorization/database-administration/#access-control-database-administration-constraints[`DROP CONSTRAINT` privilege]. diff --git a/modules/ROOT/pages/constraints/syntax.adoc b/modules/ROOT/pages/constraints/syntax.adoc index 5d0d6892e..34e5b8403 100644 --- a/modules/ROOT/pages/constraints/syntax.adoc +++ b/modules/ROOT/pages/constraints/syntax.adoc @@ -64,7 +64,7 @@ REQUIRE (r.propertyName_1, ..., r.propertyName_n) IS [REL[ATIONSHIP]] UNIQUE [OPTIONS "{" option: value[, ...] "}"] ---- -For more examples on how to create property uniqueness constraints, see xref:constraints/managing-constraints.adoc#create-property-uniqueness-constraints[Create, show, and drop constraints -> Create property uniqueness constraint]. +For examples on how to create property uniqueness constraints, see xref:constraints/managing-constraints.adoc#create-property-uniqueness-constraints[Create, show, and drop constraints -> Create property uniqueness constraint]. Property uniqueness constraints are xref:constraints/managing-constraints.adoc#constraints-and-indexes[index-backed]. [role=label--enterprise-edition] @@ -91,7 +91,7 @@ REQUIRE r.propertyName IS NOT NULL There are no supported `OPTIONS` values for property existence constraints, but an empty options map is allowed for consistency. -For more examples on how to create property existence constraints, see xref:constraints/managing-constraints.adoc#create-property-existence-constraints[Create, show, and drop constraints -> Create property existence constraints]. +For examples on how to create property existence constraints, see xref:constraints/managing-constraints.adoc#create-property-existence-constraints[Create, show, and drop constraints -> Create property existence constraints]. [role=label--enterprise-edition label--new-5.9] [[create-property-type-constraints]] @@ -148,7 +148,7 @@ Allowed syntax variations of these types are listed in xref::values-and-types/p There are no supported `OPTIONS` values for property type constraints, but an empty options map is allowed for consistency. -For more examples on how to create property type constraints, see xref:constraints/managing-constraints.adoc#create-property-type-constraint[Create, show, and drop constraints -> Create property type constraints]. +For examples on how to create property type constraints, see xref:constraints/managing-constraints.adoc#create-property-type-constraint[Create, show, and drop constraints -> Create property type constraints]. [role=label--enterprise-edition] @@ -193,7 +193,7 @@ REQUIRE (r.propertyName_1, ..., r.propertyName_n) IS [REL[ATIONSHIP]] KEY An index provider can be specified using the `OPTIONS` clause. -For more examples on how to create key constraints, see xref:constraints/managing-constraints.adoc#create-key-constraints[Create, show, and drop constraints -> Create key constraints]. +For examples on how to create key constraints, see xref:constraints/managing-constraints.adoc#create-key-constraints[Create, show, and drop constraints -> Create key constraints]. Key constraints are xref:constraints/managing-constraints.adoc#constraints-and-indexes[index-backed]. @@ -307,6 +307,8 @@ label:new[Introduced in 5.7] |=== +For examples on how to list constraints, see xref:constraints/managing-constraints.adoc#list-constraints[Create, show, and drop constraints -> SHOW CONSTRAINTS]. + [[drop-constraint]] == DROP CONSTRAINT @@ -328,3 +330,4 @@ This means its default behavior is to throw an error if an attempt is made to dr With the `IF EXISTS` flag, no error is thrown and nothing happens should the constraint not exist. As of Neo4j 5.17, an informational notification is instead returned detailing that the constraint does not exist. +For examples on how to drop constraints, see xref:constraints/managing-constraints.adoc#drop-constraint[Create, show, and drop constraints -> DROP CONSTRAINT].