Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion modules/ROOT/content-nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@
** xref:indexes/syntax.adoc[]

* xref:constraints/index.adoc[]
** xref:constraints/managing-constraints.adoc[]
** xref:constraints/create-constraints.adoc[]
** xref:constraints/list-constraints.adoc[]
** xref:constraints/drop-constraints.adoc[]
** xref:constraints/syntax.adoc[]

* xref:planning-and-tuning/index.adoc[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,16 +600,16 @@ GQL supports `GRAPH TYPES` as a way of constraining a graph schema, but does not
| Cypher feature
| Description

| xref:constraints/managing-constraints.adoc#create-property-uniqueness-constraints[Property uniqueness constraints]
| xref:constraints/create-constraints.adoc#create-property-uniqueness-constraints[Property uniqueness constraints]
| Ensures that the combined property values are unique for all nodes with a specific label or all relationships with a specific type.

| xref:constraints/managing-constraints.adoc#create-property-existence-constraints[Property existence constraints]
| xref:constraints/create-constraints.adoc#create-property-existence-constraints[Property existence constraints]
| Ensures that a property exists either for all nodes with a specific label or for all relationships with a specific type.

| xref:constraints/managing-constraints.adoc#create-property-type-constraints[Property type constraints]
| xref:constraints/create-constraints.adoc#create-property-type-constraints[Property type constraints]
| Ensures that a property has the required property type for all nodes with a specific label or for all relationships with a specific type.

| xref:constraints/managing-constraints.adoc#create-key-constraints[Key constraints]
| xref:constraints/create-constraints.adoc#create-key-constraints[Key constraints]
| Ensures 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.

|===
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ Predicates that will not work:

[NOTE]
====
If there is a xref:constraints/managing-constraints.adoc#create-property-existence-constraints[property existence constraint] on the property, no predicate is required to trigger the optimization.
If there is a xref:constraints/create-constraints.adoc#create-property-existence-constraints[property existence constraint] on the property, no predicate is required to trigger the optimization.
For example, `CREATE CONSTRAINT constraint_name FOR (p:Person) REQUIRE p.name IS NOT NULL`

Predicates with parameters, such as `WHERE n.prop > $param`, can trigger _index-backed ORDER BY_.
Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/pages/clauses/load-csv.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ For more `STRING` manipulation functions, see xref:functions/string.adoc[String

=== Create property uniqueness constraints

Always create xref:constraints/managing-constraints.adoc#create-property-uniqueness-constraints[property uniqueness constraints] prior to importing data, to avoid duplicates or colliding entities.
Always create xref:constraints/create-constraints.adoc#create-property-uniqueness-constraints[property uniqueness constraints] prior to importing data, to avoid duplicates or colliding entities.
If the source file contains duplicated data and the right constraints are in place, Cypher raises an error.

.Create a node property uniqueness constraints on person ID
Expand Down
4 changes: 2 additions & 2 deletions modules/ROOT/pages/clauses/merge.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ If partial matches are needed, this can be accomplished by splitting a pattern i
[NOTE]
====
Under concurrent updates, `MERGE` only guarantees the existence of the `MERGE` pattern, but not uniqueness.
To guarantee uniqueness of nodes with certain properties, a xref:constraints/managing-constraints.adoc#create-property-uniqueness-constraints[property uniqueness constraint] should be used.
To guarantee uniqueness of nodes with certain properties, a xref:constraints/create-constraints.adoc#create-property-uniqueness-constraints[property uniqueness constraint] should be used.
See xref::clauses/merge.adoc#query-merge-using-unique-constraints[Using property uniqueness constraints with `MERGE`].
====

Expand Down Expand Up @@ -511,7 +511,7 @@ This is in contrast to the example shown above in xref::clauses/merge.adoc#merge
[[query-merge-using-unique-constraints]]
== Using node property uniqueness constraints with `MERGE`

Cypher prevents getting conflicting results from `MERGE` when using patterns that involve xref:constraints/managing-constraints.adoc#create-property-uniqueness-constraints[property uniqueness constraints].
Cypher prevents getting conflicting results from `MERGE` when using patterns that involve xref:constraints/create-constraints.adoc#create-property-uniqueness-constraints[property uniqueness constraints].
In this case, there must be at most one node that matches that pattern.

For example, given two property node uniqueness constraints on `:Person(id)` and `:Person(ssn)`, a query such as `MERGE (n:Person {id: 12, ssn: 437})` will fail, if there are two different nodes (one with `id` 12 and one with `ssn` 437), or if there is only one node with only one of the properties.
Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/pages/clauses/optional-match.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ For example, the matching variables from one `MATCH` clause will provide the con
However, there are two important differences between Neo4j and SQL which helps to explain `OPTIONAL MATCH` further.

. While it is both possible and advised to enforce partial schemas using indexes and constraints, Neo4j offers a greater degree of schema flexibility than a relational database.
Nodes and relationships in a Neo4j database do not have to have a specific property set to them because other nodes or relationships in the same graph have that property (unless there is a xref:constraints/managing-constraints.adoc#create-property-existence-constraints[property existence constraint] created on the specific property).
Nodes and relationships in a Neo4j database do not have to have a specific property set to them because other nodes or relationships in the same graph have that property (unless there is a xref:constraints/create-constraints.adoc#create-property-existence-constraints[property existence constraint] created on the specific property).

. Queries in Cypher are run as pipelines.
If a clause returns no results, it will effectively end the query as subsequent clauses will have no data to execute upon.
Expand Down
Loading