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
Copy file name to clipboardExpand all lines: modules/ROOT/pages/constraints/managing-constraints.adoc
+16-17Lines changed: 16 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -344,7 +344,7 @@ Added 1 constraint.
344
344
345
345
======
346
346
347
-
.Create `VECTOR` property type constraints label:cypher[Cypher 25 only] label:new[Introduced in Neo4j 2025.xx]
347
+
.Create `VECTOR` property type constraints label:cypher[Cypher 25 only] label:new[Introduced in Neo4j 2025.10]
348
348
======
349
349
350
350
It is necessary to specify both the dimension and the coordinate type of any constrained `VECTOR` properties.
@@ -436,7 +436,7 @@ The allowed property types for property type constraints are:
436
436
* `ZONED DATETIME`
437
437
* `DURATION`
438
438
* `POINT`
439
-
* `VECTOR<TYPE>(DIMENSION)` label:cypher[Cypher 25 only] label:new[Introduced in Neo4j 2025.xx]
439
+
* `VECTOR<TYPE>(DIMENSION)` label:cypher[Cypher 25 only] label:new[Introduced in Neo4j 2025.10]
440
440
* `LIST<BOOLEAN NOT NULL>`
441
441
* `LIST<STRING NOT NULL>`
442
442
* `LIST<INTEGER NOT NULL>`
@@ -451,8 +451,7 @@ The allowed property types for property type constraints are:
451
451
* Any closed dynamic union of the above types, e.g. `INTEGER | FLOAT | STRING`.
452
452
453
453
[NOTE]
454
-
A property type constraint cannot be created for `LIST<VECTOR<TYPE>(DIMENSION) NOT NULL>`.
455
-
This is because it is not possible to store lists of xref:values-and-types/vector.adoc[`VECTOR`] values.
454
+
Because storing lists of xref:values-and-types/vector.adoc[`VECTOR`] values is not supported, property type constraints cannot be created for `LIST<VECTOR<TYPE>(DIMENSION) NOT NULL>`.
456
455
457
456
For a complete reference describing all types available in Cypher, see the section on xref::values-and-types/property-structural-constructed.adoc#types-synonyms[types and their synonyms].
458
457
@@ -737,7 +736,7 @@ Additionally, some constraints cannot coexist and attempting to create them toge
737
736
This includes:
738
737
739
738
* Property type constraints on the same label/relationship type and property but with different property types.
740
-
This includes `VECTOR` types with differing dimensions or coordinate types.
739
+
This includes `VECTOR` types with different dimensions or coordinate types.
741
740
* Property uniqueness and key constraints on the same label/relationship type and property combination.
742
741
743
742
However, some constraint types are allowed on the same label/relationship type and property combination.
@@ -1096,7 +1095,7 @@ A constraint cannot be created until the index has been dropped.
1096
1095
| *Property uniqueness constraint*
1097
1096
|
1098
1097
^| ❌
1099
-
|
1098
+
|
1100
1099
1101
1100
| *Property existence constraint*
1102
1101
^| ❌
@@ -1263,7 +1262,7 @@ Node(9) with label `Movie` required the property `title` to be of type `STRING`,
1263
1262
| *Property uniqueness constraint*
1264
1263
|
1265
1264
^| ❌
1266
-
|
1265
+
|
1267
1266
1268
1267
| *Property existence constraint*
1269
1268
^| ❌
@@ -1365,7 +1364,7 @@ RETURN wrote
1365
1364
| Query
1366
1365
1367
1366
| Node property uniqueness constraint
1368
-
a|
1367
+
a|
1369
1368
[source]
1370
1369
----
1371
1370
MATCH (n1:Label), (n2:Label)
@@ -1374,7 +1373,7 @@ RETURN n1, n2
1374
1373
----
1375
1374
1376
1375
| Relationship property uniqueness constraint
1377
-
a|
1376
+
a|
1378
1377
[source]
1379
1378
----
1380
1379
MATCH ()-[r1:REL_TYPE]->(), ()-[r2:REL_TYPE]->()
@@ -1383,7 +1382,7 @@ RETURN r1, r2
1383
1382
----
1384
1383
1385
1384
| Node property existence constraint
1386
-
a|
1385
+
a|
1387
1386
[source]
1388
1387
----
1389
1388
MATCH (n:Label)
@@ -1392,7 +1391,7 @@ RETURN n
1392
1391
----
1393
1392
1394
1393
| Relationship property existence constraint
1395
-
a|
1394
+
a|
1396
1395
[source]
1397
1396
----
1398
1397
MATCH ()-[r:REL_TYPE]->()
@@ -1401,7 +1400,7 @@ RETURN r
1401
1400
----
1402
1401
1403
1402
| Node property type constraint
1404
-
a|
1403
+
a|
1405
1404
[source]
1406
1405
----
1407
1406
MATCH (n:Label)
@@ -1410,7 +1409,7 @@ RETURN n
1410
1409
----
1411
1410
1412
1411
| Relationship property type constraint
1413
-
a|
1412
+
a|
1414
1413
[source]
1415
1414
----
1416
1415
MATCH ()-[r:REL_TYPE]->()
@@ -1419,7 +1418,7 @@ RETURN r
1419
1418
----
1420
1419
1421
1420
| Node key constraint
1422
-
a|
1421
+
a|
1423
1422
[source]
1424
1423
----
1425
1424
MATCH (n1:Label), (n2:Label)
@@ -1433,7 +1432,7 @@ RETURN n AS node, 'non-existing' AS reason
1433
1432
----
1434
1433
1435
1434
| Relationship key constraint
1436
-
a|
1435
+
a|
1437
1436
[source]
1438
1437
----
1439
1438
MATCH ()-[r1:REL_TYPE]->(), ()-[r2:REL_TYPE]->()
@@ -1701,7 +1700,7 @@ label:default-output[]
1701
1700
== DROP CONSTRAINT
1702
1701
1703
1702
Constraints are dropped using the `DROP CONSTRAINT` command.
1704
-
It is possible to drop a constraint that was created in a later Cypher version than the one currently in use.
1703
+
It is possible to drop constraints created in a different Cypher version than the one in use.
1705
1704
For example, although `VECTOR` property type constraints were added in Cypher 25, such constraints can still be dropped using Cypher 5.
1706
1705
1707
1706
For the full command syntax to drop constraints, see xref:constraints/syntax.adoc#drop-constraint[Syntax -> DROP CONSTRAINT].
@@ -1791,4 +1790,4 @@ DROP CONSTRAINT missing_constraint_name IF EXISTS
1791
1790
`DROP CONSTRAINT missing_constraint_name IF EXISTS` has no effect. `missing_constraint_name` does not exist.
Copy file name to clipboardExpand all lines: modules/ROOT/pages/constraints/syntax.adoc
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ If a name is not explicitly given, a unique name will be auto-generated.
19
19
[NOTE]
20
20
Creating a constraint requires the link:{neo4j-docs-base-uri}/operations-manual/current/authentication-authorization/database-administration/#access-control-database-administration-constraints[`CREATE CONSTRAINT` privilege].
21
21
22
-
The `CREATE CONSTRAINT` command is optionally idempotent.
22
+
The `CREATE CONSTRAINT` command is optionally idempotent.
23
23
This means its default behavior is to throw an error if an attempt is made to create the same constraint twice.
24
24
With the `IF NOT EXISTS` flag, no error is thrown and nothing happens should a constraint with the same name or same schema and constraint type already exist.
25
25
It may still throw an error if conflicting data, indexes, or constraints exist.
@@ -122,7 +122,7 @@ Where `<TYPE>` is one of the following property types:
122
122
* `ZONED DATETIME`
123
123
* `DURATION`
124
124
* `POINT`
125
-
* `VECTOR<TYPE>(DIMENSION)` label:cypher[Cypher 25 only] label:new[Introduced in Neo4j 2025.xx]
125
+
* `VECTOR<TYPE>(DIMENSION)` label:cypher[Cypher 25 only] label:new[Introduced in Neo4j 2025.10]
126
126
* `LIST<BOOLEAN NOT NULL>`
127
127
* `LIST<STRING NOT NULL>`
128
128
* `LIST<INTEGER NOT NULL>`
@@ -137,8 +137,7 @@ Where `<TYPE>` is one of the following property types:
137
137
* Any closed dynamic union of the above types, e.g. `INTEGER | FLOAT | STRING`.
138
138
139
139
[NOTE]
140
-
A property type constraint cannot be created for `LIST<VECTOR<TYPE>(DIMENSION) NOT NULL>`.
141
-
This is because it is not possible to store lists of `VECTOR` values.
140
+
Because storing lists of xref:values-and-types/vector.adoc[`VECTOR`] values is not supported, property type constraints cannot be created for `LIST<VECTOR<TYPE>(DIMENSION) NOT NULL>`.
142
141
Additionally, `VECTOR` property type constraints must be created with a specific dimension and coordinate value, where the dimension must be greater than `0` and less or equal to `4096`.
143
142
For more information, see xref:values-and-types/vector.adoc[Values and types -> Vectors].
144
143
@@ -317,4 +316,4 @@ This means its default behavior is to throw an error if an attempt is made to dr
317
316
With the `IF EXISTS` flag, no error is thrown and nothing happens should the constraint not exist.
318
317
Instead, an informational notification is returned detailing that the constraint does not exist.
319
318
320
-
For examples on how to drop constraints, see xref:constraints/managing-constraints.adoc#drop-constraint[Create, show, and drop constraints -> DROP CONSTRAINT].
319
+
For examples on how to drop constraints, see xref:constraints/managing-constraints.adoc#drop-constraint[Create, show, and drop constraints -> DROP CONSTRAINT].
0 commit comments