You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| Ensures that certain relationships have a set of defined properties whose combined value is unique. It also ensures that all properties in the set are present.
| 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.
Copy file name to clipboardExpand all lines: modules/ROOT/pages/clauses/load-csv.adoc
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -601,12 +601,12 @@ For more `STRING` manipulation functions, see xref:functions/string.adoc[String
601
601
602
602
== Recommendations
603
603
604
-
=== Create uniqueness constraints
604
+
=== Create property uniqueness constraints
605
605
606
-
Always create uniqueness xref:constraints/index.adoc[constraints] prior to importing data, to avoid duplicates or colliding entities.
606
+
Always create xref:constraints/managing-constraints.adoc#create-property-uniqueness-constraints[property uniqueness constraints] prior to importing data, to avoid duplicates or colliding entities.
607
607
If the source file contains duplicated data and the right constraints are in place, Cypher raises an error.
608
608
609
-
.Create xref:constraints/examples.adoc#constraints-examples-node-uniqueness[node property uniqueness constraints] on person ID
609
+
.Create a node property uniqueness constraints on person ID
Copy file name to clipboardExpand all lines: modules/ROOT/pages/clauses/merge.adoc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ If partial matches are needed, this can be accomplished by splitting a pattern i
25
25
[NOTE]
26
26
====
27
27
Under concurrent updates, `MERGE` only guarantees the existence of the `MERGE` pattern, but not uniqueness.
28
-
To guarantee uniqueness of nodes with certain properties, a xref::constraints/index.adoc[property uniqueness constraint] should be used.
28
+
To guarantee uniqueness of nodes with certain properties, a xref:constraints/managing-constraints.adoc#create-property-uniqueness-constraints[property uniqueness constraint] should be used.
29
29
See xref::clauses/merge.adoc#query-merge-using-unique-constraints[Using property uniqueness constraints with `MERGE`].
30
30
====
31
31
@@ -511,7 +511,7 @@ This is in contrast to the example shown above in xref::clauses/merge.adoc#merge
511
511
[[query-merge-using-unique-constraints]]
512
512
== Using node property uniqueness constraints with `MERGE`
513
513
514
-
Cypher prevents getting conflicting results from `MERGE` when using patterns that involve property uniqueness constraints.
514
+
Cypher prevents getting conflicting results from `MERGE` when using patterns that involve xref:constraints/managing-constraints.adoc#create-property-uniqueness-constraints[property uniqueness constraints].
515
515
In this case, there must be at most one node that matches that pattern.
516
516
517
517
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.
Copy file name to clipboardExpand all lines: modules/ROOT/pages/clauses/optional-match.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ For example, the matching variables from one `MATCH` clause will provide the con
54
54
However, there are two important differences between Neo4j and SQL which helps to explain `OPTIONAL MATCH` further.
55
55
56
56
. 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.
57
-
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 existenceconstraint created on the specific property).
57
+
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).
58
58
59
59
. Queries in Cypher are run as pipelines.
60
60
If a clause returns no results, it will effectively end the query as subsequent clauses will have no data to execute upon.
0 commit comments