Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Constraint Types to headers #837

Merged
merged 3 commits into from
Jan 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
small update
JPryce-Aklundh committed Jan 15, 2024
commit eba6d318dedd36543cbc211ebc62655603d7da68
12 changes: 2 additions & 10 deletions modules/ROOT/pages/constraints/index.adoc
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@

This page contains an overview of the available constraints in Cypher, and information about how constraints can impact indexes.

Adding constraints is an atomic operation that can take a while -- all existing data has to be scanned before a Neo4j DBMS can use a constraint.

[[unique-node-property]]
== Unique node property constraints
Unique node property constraints, or node property uniqueness constraints, ensure that property values are unique for all nodes with a specific label.
@@ -122,13 +124,3 @@ Creating a constraint has the following implications on indexes:
Refer to xref::indexes-for-search-performance.adoc[] for more details on indexes.
* If a node key, relationship key, or property uniqueness constraint is dropped and the backing index is still required, the index need to be created explicitly.

Additionally, the following is true for constraints:

* A given label or relationship type can have multiple constraints, and uniqueness and property existence constraints can be combined on the same property.
* Adding constraints is an atomic operation that can take a while -- all existing data has to be scanned before Neo4j DBMS can turn the constraint 'on'.
* Best practice is to give the constraint a name when it is created.
If the constraint is not explicitly named, it will get an auto-generated name.
* The constraint name must be unique among both indexes and constraints.
* Constraint creation is by default not idempotent, and an error will be thrown if you attempt to create the same constraint twice.
Using the keyword `IF NOT EXISTS` makes the command idempotent, and no error will be thrown if you attempt to create the same constraint twice.