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
+44Lines changed: 44 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -344,6 +344,41 @@ Added 1 constraint.
344
344
345
345
======
346
346
347
+
.Create `VECTOR` property type constraints
348
+
======
349
+
350
+
It is necessary to specify both the dimension and the coordinate type of any constrained `VECTOR` properties.
351
+
The dimension must be greater than `0` and less or equal to `4096`.
352
+
For more information, see xref:values-and-types/vectors.adoc[Values and types -> Vectors].
353
+
354
+
.Create a constraint requiring `embedding` properties on `Movie` nodes to be of type `VECTOR<INT32>(42)`
355
+
[source, cypher]
356
+
----
357
+
CREATE CONSTRAINT node_vector_constraint
358
+
FOR (n:Movie) REQUIRE n.embedding IS :: VECTOR<INT32>(42)
359
+
----
360
+
361
+
.Result
362
+
[source, queryresult]
363
+
----
364
+
Added 1 constraint.
365
+
----
366
+
367
+
.Create a constraint requiring `embedding` properties on `CONTAINS` relationships to be of type `VECTOR<FLOAT32>(1536)`
368
+
[source, cypher]
369
+
----
370
+
CREATE CONSTRAINT rel_vector_constraint
371
+
FOR ()-[r:CONTAINS]->() REQUIRE r.embedding IS :: VECTOR<FLOAT32>(1536)
372
+
----
373
+
374
+
.Result
375
+
[source, queryresult]
376
+
----
377
+
Added 1 constraint.
378
+
----
379
+
380
+
======
381
+
347
382
[[create-property-type-constraint-union-type]]
348
383
==== Create property type constraints with a union type
349
384
@@ -401,6 +436,7 @@ The allowed property types for property type constraints are:
401
436
* `ZONED DATETIME`
402
437
* `DURATION`
403
438
* `POINT`
439
+
* `VECTOR<TYPE>(DIMENSION)` label:new[Introduced in Neo4j 2025.xx]
404
440
* `LIST<BOOLEAN NOT NULL>`
405
441
* `LIST<STRING NOT NULL>`
406
442
* `LIST<INTEGER NOT NULL>`
@@ -414,6 +450,10 @@ The allowed property types for property type constraints are:
414
450
* `LIST<POINT NOT NULL>`
415
451
* Any closed dynamic union of the above types, e.g. `INTEGER | FLOAT | STRING`.
416
452
453
+
[NOTE]
454
+
A property type constraint cannot be created for `LIST<VECTOR NOT NULL>`.
455
+
This is because it is not possible to store lists of xref:values-and-types/vectors.adoc[`VECTOR`] values.
456
+
417
457
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].
Copy file name to clipboardExpand all lines: modules/ROOT/pages/constraints/syntax.adoc
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,6 +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:new[Introduced in Neo4j 2025.xx]
125
126
* `LIST<BOOLEAN NOT NULL>`
126
127
* `LIST<STRING NOT NULL>`
127
128
* `LIST<INTEGER NOT NULL>`
@@ -135,6 +136,12 @@ Where `<TYPE>` is one of the following property types:
135
136
* `LIST<POINT NOT NULL>`
136
137
* Any closed dynamic union of the above types, e.g. `INTEGER | FLOAT | STRING`.
137
138
139
+
[NOTE]
140
+
A property type constraint cannot be created for `LIST<VECTOR NOT NULL>`.
141
+
This is because it is not possible to store lists of `VECTOR` values.
142
+
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
+
For more information, see xref:values-and-types/vectors.adoc[Values and types -> Vectors].
144
+
138
145
Allowed syntax variations of these types are listed in xref::values-and-types/property-structural-constructed.adoc#types-synonyms[Types and their synonyms].
139
146
140
147
For examples on how to create property type constraints, see xref:constraints/managing-constraints.adoc#create-property-type-constraints[Create, show, and drop constraints -> Create property type constraints].
Copy file name to clipboardExpand all lines: modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,36 @@ Cypher 25 was introduced in Neo4j 2025.06 and can only be used on Neo4j 2025.06+
22
22
Features removed in Cypher 25 are still available on Neo4j 2025.06+ databases either by prepending a query with `CYPHER 5` or by having Cypher 5 as the default language for the database.
23
23
For more information, see xref:queries/select-version.adoc[].
0 commit comments