Skip to content

Commit 1272673

Browse files
authored
Merge branch 'dev' into 2025.x-next-by-table-semantics
2 parents d091987 + 2e4a679 commit 1272673

File tree

13 files changed

+133
-12
lines changed

13 files changed

+133
-12
lines changed

modules/ROOT/pages/clauses/clause-composition.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ In a Cypher query, read and write clauses can take turns.
129129
The most important aspect of read-write queries is that the state of the graph also changes between clauses.
130130

131131
[IMPORTANT]
132+
====
132133
A clause can never observe writes made by a later clause, and will observe all writes done by the previous clauses.
134+
====
133135

134136
As of Cypher 25, read and write clauses can be combined in any order.
135137
That is, a write clause followed by a read clause no longer requires a separating xref:clauses/with.adoc[`WITH`] clause in order for the read clause to observe the changes made by a preceding write clause.

modules/ROOT/pages/clauses/filter.adoc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,38 @@ RETURN p.name AS person,
9393
3+|Rows: 2
9494
|===
9595

96+
[[filter-on-dynamic-labels-and-types]]
97+
== Filter on dynamic labels and types
98+
99+
To filter on a label or relationship type using a dynamically computed value, use `$(<expr>)` where <expr> is any Cypher expression:
100+
101+
.Parameters
102+
[source, parameters]
103+
----
104+
{
105+
"label": "Swedish"
106+
}
107+
----
108+
109+
.Filter on a dynamically computed node label
110+
// tag::clauses_where_dynamic[]
111+
[source, cypher]
112+
----
113+
MATCH (n)
114+
FILTER n:$($label)
115+
RETURN labels(n) AS labels
116+
----
117+
// end::clauses_where_dynamic[]
118+
119+
.Result
120+
[role="queryresult",options="header,footer",cols="1*<m"]
121+
|===
122+
| labels
123+
| ["Person", "Swedish"]
124+
1+d|Rows: 1
125+
|===
126+
127+
96128
[[filter-on-dynamic-properties]]
97129
== Filter on dynamic properties
98130

modules/ROOT/pages/clauses/where.adoc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,38 @@ RETURN f.name AS oldFriend
103103
|===
104104

105105

106+
[[filter-on-dynamic-labels-and-types]]
107+
== Filter on dynamic labels and types
108+
109+
To filter on a label or relationship type using a dynamically computed value, use `$(<expr>)` where <expr> is any Cypher expression:
110+
111+
.Parameters
112+
[source, parameters]
113+
----
114+
{
115+
"label": "Swedish"
116+
}
117+
----
118+
119+
.Filter on a dynamically computed node label
120+
// tag::clauses_where_dynamic[]
121+
[source, cypher]
122+
----
123+
MATCH (n)
124+
WHERE n:$($label)
125+
RETURN labels(n) AS labels
126+
----
127+
// end::clauses_where_dynamic[]
128+
129+
.Result
130+
[role="queryresult",options="header,footer",cols="1*<m"]
131+
|===
132+
| labels
133+
| ["Person", "Swedish"]
134+
1+d|Rows: 1
135+
|===
136+
137+
106138
[[filter-on-dynamic-properties]]
107139
== Filter on dynamic properties
108140

modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,31 @@ Cypher 25 was introduced in Neo4j 2025.06 and can only be used on Neo4j 2025.06+
2222
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.
2323
For more information, see xref:queries/select-version.adoc[].
2424

25+
[[cypher-deprecations-additions-removals-2025.07]]
26+
== Neo4j 2025.07
27+
28+
=== Updated in Cypher 25
29+
30+
[cols="2", options="header"]
31+
|===
32+
| Feature
33+
| Details
34+
35+
a|
36+
label:functionality[]
37+
label:updated[]
38+
[source, cypher, role="noheader"]
39+
----
40+
MATCH (n)-[r]->()
41+
WHERE n:$(<expr1>)
42+
WITH n, r:$(<expr2>) AS hasType
43+
RETURN n:$(<expr3>)
44+
----
45+
46+
| Added the ability to dynamically reference node labels and relationship types in places where xref:patterns/reference.adoc#label-expressions[label expressions] are allowed.
47+
|===
48+
49+
2550
[[cypher-deprecations-additions-removals-2025.06]]
2651
== Neo4j 2025.06
2752

modules/ROOT/pages/introduction/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[[cypher-intro]]
22
ifdef::backend-pdf[]
3-
= Neo4j {neo4j-version} Cypher Manual
3+
= Neo4j Cypher {page-version} Manual
44
endif::[]
55
ifndef::backend-pdf[]
66
= Introduction

modules/ROOT/pages/patterns/match-modes.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,3 +256,9 @@ RETURN count(p) AS pathCount
256256
----
257257
The quantified path pattern may yield an infinite number of rows under match mode 'REPEATABLE ELEMENTS'. Add an upper bound to the quantified path pattern.
258258
----
259+
260+
261+
[[further-reading]]
262+
== Further reading
263+
264+
* link:https://medium.com/neo4j/i-would-walk-500-miles-5d23c33d967f[Neo4j Developer Blog: I Would Walk 500 Miles]

modules/ROOT/pages/patterns/reference.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,19 @@ The following matches relationships that have a type that is neither `A` nor `B`
314314
-[:!A&!B]->
315315
----
316316

317+
[[dynamic-label-and-type-expressions]]
318+
=== Dynamic label and type expressions
319+
320+
Node labels and relationship types can be referenced dynamically in expressions, parameters, and variables within label expressions.
321+
322+
.Syntax for creating nodes and relationships dynamically
323+
[source, syntax]
324+
----
325+
dynamicLabelExpression ::= ":$(" + valueExpression ")"
326+
----
327+
328+
The `valueExpression` must evaluate to a `STRING NOT NULL | LIST<STRING NOT NULL> NOT NULL` value.
329+
317330
[[property-key-value-expressions]]
318331
== Property key-value expressions
319332

modules/ROOT/pages/patterns/variable-length-patterns.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,4 +562,4 @@ Using inline predicates or making quantified path patterns more specific where p
562562
== Further reading
563563

564564
* link:https://medium.com/neo4j/getting-from-denmark-hill-to-gatwick-airport-with-quantified-path-patterns-bed38da27ca1[Neo4j Developer Blog: Getting From Denmark Hill to Gatwick Airport With Quantified Path Patterns]
565-
* link:https://medium.com/neo4j/did-you-take-the-neo4j-5-cypher-bullet-train-6a857c92d669[Neo4j Developer Blog: Did You Take the Neo4j 5 Cypher Bullet Train?]
565+
* link:https://medium.com/neo4j/did-you-take-the-neo4j-5-cypher-bullet-train-6a857c92d669[Neo4j Developer Blog: Did You Take the Neo4j 5 Cypher Bullet Train?]

modules/ROOT/pages/planning-and-tuning/execution-plans.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ The `id` column specifies a unique ID assigned to each operator.
141141
There are no guarantees about the order of the ids, although they will usually start with 0 at the root operator, and will increase until the leaf operator is reached at the beginning of the operator tree.
142142

143143
The `Details` column in the middle of the execution plan describes what task is performed by each operator.
144-
For example, the details column of the xref::planning-and-tuning/operators/operators-detail.adoc#query-plan-repeat[Repeat(Trail)] operator in the middle of the execution plan (`id 5`), specifies that the operator traverses a quantified path pattern without an upward limit.
144+
For example, the details column of the xref::planning-and-tuning/operators/operators-detail.adoc#query-plan-repeat[Repeat] operator in the middle of the execution plan (`id 5`), specifies that the operator traverses a quantified path pattern without an upward limit.
145145

146146
Finally, the `Estimated Rows` column details the number of rows that are expected to be produced by each operator.
147147
This estimate is an approximate number based on the available statistical information and the planner uses it to choose a suitable execution plan.footnote:[The statistical information maintained by Neo4j includes the following: the number of nodes having a certain label, the number of relationships by type, selectivity per index, and the number of relationships by type, ending with or starting from a node with a specific label.]

modules/ROOT/pages/planning-and-tuning/operators/index.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,8 @@ Tests for the presence of a pattern predicate in queries containing multiple pat
423423
|
424424

425425
| xref::planning-and-tuning/operators/operators-detail.adoc#query-plan-nullify-metadata[NullifyMetadata]
426-
| responsible for cleaning up the state produced by xref:planning-and-tuning/operators/operators-detail.adoc#query-plan-repeat[`Repeat(Trail)`].
427-
It is only planned directly after `Repeat(Trail)`.
426+
| responsible for cleaning up the state produced by xref:planning-and-tuning/operators/operators-detail.adoc#query-plan-repeat[`Repeat`].
427+
It is only planned directly after `Repeat`.
428428
|
429429
|
430430
|
@@ -632,7 +632,7 @@ It also fetches the start and end nodes of those relationships.
632632
|
633633
|
634634

635-
| xref::planning-and-tuning/operators/operators-detail.adoc#query-plan-repeat[Repeat(Trail)]
635+
| xref::planning-and-tuning/operators/operators-detail.adoc#query-plan-repeat[Repeat]
636636
| Solves quantified path patterns.
637637
|
638638
|

0 commit comments

Comments
 (0)