Skip to content

Commit 6a54b9a

Browse files
2025.03 update and procedures section
1 parent 8b25fa4 commit 6a54b9a

File tree

1 file changed

+34
-7
lines changed

1 file changed

+34
-7
lines changed

modules/ROOT/pages/queries/select-version.adoc

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,33 @@
55
Users can specify the version of Cypher in which they want to run their queries, choosing between Cypher 5 and Cypher 25.
66
The Cypher version can be set for individual queries or as the default language for a database.
77

8+
[[cypher-versions-explained]]
89
== Cypher 5, Cypher 25, and Neo4j explained
910

1011
Starting in 2025, the Neo4j server transitioned to a calendar-based versioning system.
1112
This means Neo4j will no longer use its previous semantic versioning and release pattern (e.g., 5.25, 5.26).
1213
Instead, releases from 2025 onwards will follow a *YYYY.MM* format, beginning with version 2025.01 released in January 2025, followed by 2025.02 released in February 2025, and so on.
1314

14-
Cypher 25 is introduced alongside Neo4j 2025.02 and is the default language for databases running version 2025.02 or later.
15-
However, users running Neo4j version 2025.02 or later can choose to run their queries using the previous version of Cypher: Cypher 5.
15+
Cypher 25 is introduced alongside Neo4j 2025.03 and is the default language for newly created databases running version 2025.03 or later.
16+
However, users running Neo4j version 2025.03 or later can choose to run their queries using the previous version of Cypher: Cypher 5.
1617
If so, Neo4j will use Cypher as it existed at the time of the Neo4j 5.26 long-term support release.
1718

19+
[NOTE]
20+
Databases migrating to Neo4j 2025.03+ from earlier versions will continue to use Cypher 5 as their default language.
21+
To change the default language on such databases, see xref:queries/select-version.adoc#alter-default-cypher-version[Alter the default Cypher version for a database] below.
22+
1823
For information about updates to Cypher in different Neo4j versions, see xref:deprecations-additions-removals-compatibility.adoc[].
1924
For information about Cypher 5, see the link:https://neo4j.com/docs/cypher-manual/5/introduction/[Cypher 5 Manual].
2025

26+
[[selection-query-cypher-version]]
2127
== Select the Cypher version for queries
2228

2329
To select the Cypher version of a query, prepend it with `CYPHER <language version>`.
2430

2531
Selecting `CYPHER 5` ensures that the query will be executed using the language as it existed at the time of the Neo4j 5.26 long-term support release.
26-
Any changes introduced in Neo4j 2025.02 or later will not affect the query.
32+
Any changes introduced in Neo4j 2025.03 or later will not affect the query.
2733

28-
Selecting `CYPHER 25` ensures that the query will be executed using the language as it exists in the version of Neo4j that the database is currently running, provided it is on Neo4j 2025.02 or later.
34+
Selecting `CYPHER 25` ensures that the query will be executed using the language as it exists in the version of Neo4j that the database is currently running, provided it is on Neo4j 2025.03 or later.
2935

3036
Below are two examples showing the two versions of Cypher behaving differently.
3137

@@ -104,6 +110,24 @@ SHOW CONSTRAINTS YIELD name, type
104110
If a database has specified a default Cypher version, it is possible to set a different Cypher version for individual queries.
105111
For example, if a database is created with Cypher 5 as its default language, prepending a query run on that database with `CYPHER 25` ensures the query uses Cypher 25.
106112

113+
[[procedures-and-functions]]
114+
=== Procedures and functions
115+
116+
link:{neo4j-docs-base-uri}/operations-manual/current/procedures[Procedures] and xref:functions/index.adoc[functions] (including built-in and link:{neo4j-docs-base-uri}/apoc/current/[APOC]) are tied to a specific Cypher language version.
117+
Therefore, procedures and functions in Neo4j 2025.03+ and APOC 2025.03+ (both of which have Cypher 25 as their default language), may behave differently depending on what version of Cypher is used.
118+
119+
For example, APOC 2025.03 removed Cypher 25 support of the procedure `apoc.create.uuids()`, meaning it is not available to queries running Cypher 25.
120+
However, it can still be used on APOC 2025.03 if queries are prepended with `CYPHER 5`, or if the database’s default version is set to `CYPHER 5`.
121+
In this case, Neo4j will use APOC and Cypher as they existed at the time of the 5.26 long-term support (LTS) release.
122+
123+
.Using a procedure removed in Cypher 25 with APOC 2025.03+
124+
[source, cypher]
125+
----
126+
CYPHER 5
127+
CALL apoc.create.uuids(10)
128+
----
129+
130+
[[cypher-selection-with-other-query-options]]
107131
=== Combine Cypher version selection with other query options
108132

109133
It is possible to combine Cypher version selection with other xref:planning-and-tuning/query-tuning.adoc[query options].
@@ -117,9 +141,10 @@ MATCH (n:Person)
117141
RETURN n.name
118142
----
119143

144+
[[select-default-cypher-version]]
120145
== Select the default Cypher version when creating a database
121146

122-
Databases created on Neo4j 2025.02 or later will have Cypher 25 as their default language.
147+
Databases created on Neo4j 2025.03 or later will have Cypher 25 as their default language.
123148
This is true for the link:{neo4j-docs-base-uri}/operations-manual/current/database-administration/#manage-database-systems[system, standard, and composite] Neo4j databases.
124149

125150
To select a different default Cypher version for a database, add `DEFAULT LANGUAGE <language version>` to the link:{neo4j-docs-base-uri}/operations-manual/current/database-administration/standard-databases/create-databases/[`CREATE DATABASE`] statement.
@@ -129,22 +154,23 @@ This can be done on any Neo4j database.
129154
Selecting a default Cypher version on a database requires the `SET DEFAULT LANGUAGE` privilege.
130155

131156
Selecting `CYPHER 5` as the default database language ensures that every query run on that database uses the language as it existed at the time of the Neo4j 5.26 long-term support release.
132-
Any changes introduced in Neo4j 2025.02 or later will not affect the query.
157+
Any changes introduced in Neo4j 2025.03 or later will not affect the semantics of the query.
133158

134159
.Create a database with Cypher 5 as the default language
135160
[source, cypher]
136161
----
137162
CREATE DATABASE my_database DEFAULT LANGUAGE CYPHER 5
138163
----
139164

140-
Selecting `CYPHER 25` ensures that the query will be executed using the language as it exists in the version of Neo4j that the database is currently running, provided it is on Neo4j 2025.02 or later.
165+
Selecting `CYPHER 25` ensures that the query will be executed using the language as it exists in the version of Neo4j that the database is currently running, provided it is on Neo4j 2025.03 or later.
141166

142167
.Create a database with Cypher 25 as the default language
143168
[source, cypher]
144169
----
145170
CREATE DATABASE my_new_database DEFAULT LANGUAGE CYPHER 25
146171
----
147172

173+
[[alter-default-cypher-version]]
148174
== Alter the default Cypher version for a database
149175

150176
To alter the default Cypher version on a database, add `SET DEFAULT LANGUAGE <language version>` to the link:{neo4j-docs-base-uri}/operations-manual/current/database-administration/standard-databases/alter-databases/[`ALTER DATABASE`] command.
@@ -164,6 +190,7 @@ ALTER DATABASE my_new_database SET DEFAULT LANGUAGE CYPHER 5
164190
ALTER DATABASE my_database SET DEFAULT LANGUAGE CYPHER 25
165191
----
166192

193+
[[show-cypher-versions]]
167194
== Show the Cypher version of databases
168195

169196
The Cypher version of a database can be seen using the link:{neo4j-docs-base-uri}/operations-manual/current/database-administration/standard-databases/listing-databases/[`SHOW DATABASES`] command as follows:

0 commit comments

Comments
 (0)