Skip to content

Commit bbf6bb7

Browse files
renetapopovamnd999HunternessNataliaIvakina
authored
Cypher25 default language (#2372)
Replaces #2153 --------- Co-authored-by: Mark Dixon <[email protected]> Co-authored-by: Therese Magnusson <[email protected]> Co-authored-by: Therese Magnusson <[email protected]> Co-authored-by: Natalia Ivakina <[email protected]>
1 parent 5532f0c commit bbf6bb7

24 files changed

+1635
-1698
lines changed

modules/ROOT/content-nav.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
** xref:configuration/file-locations.adoc[]
7979
//** xref:configuration/network-architecture.adoc[]
8080
** xref:configuration/ports.adoc[]
81+
** xref:configuration/cypher-version-configuration.adoc[]
8182
** xref:configuration/connectors.adoc[]
8283
** xref:configuration/set-initial-password.adoc[]
8384
** xref:configuration/neo4j-admin-memrec.adoc[]
@@ -116,6 +117,7 @@
116117
*** xref:database-administration/standard-databases/seed-from-uri.adoc[]
117118
*** xref:database-administration/standard-databases/listing-databases.adoc[]
118119
*** xref:database-administration/standard-databases/alter-databases.adoc[]
120+
*** xref:database-administration/standard-databases/start-stop-databases.adoc[]
119121
*** xref:database-administration/standard-databases/recreate-database.adoc[]
120122
*** xref:database-administration/standard-databases/delete-databases.adoc[]
121123
*** xref:database-administration/standard-databases/migrate-database.adoc[]
@@ -132,6 +134,8 @@
132134
*** xref:database-administration/composite-databases/concepts.adoc[]
133135
*** xref:database-administration/composite-databases/create-composite-databases.adoc[]
134136
*** xref:database-administration/composite-databases/list-composite-databases.adoc[]
137+
*** xref:database-administration/composite-databases/alter-composite-databases.adoc[]
138+
*** xref:database-administration/composite-databases/start-stop-composite-databases.adoc[]
135139
*** xref:database-administration/composite-databases/delete-composite-databases.adoc[]
136140
*** xref:database-administration/composite-databases/querying-composite-databases.adoc[]
137141
*** xref:database-administration/composite-databases/sharding-with-copy.adoc[]

modules/ROOT/images/privileges_grant_and_deny_syntax_dbms_privileges.svg

Lines changed: 1 addition & 142 deletions
Loading

modules/ROOT/images/privileges_hierarchy_dbms.svg

Lines changed: 1 addition & 750 deletions
Loading

modules/ROOT/pages/authentication-authorization/dbms-administration.adoc

Lines changed: 773 additions & 456 deletions
Large diffs are not rendered by default.

modules/ROOT/pages/backup-restore/copy-database.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ If you go from `high_limit` to `standard` or `aligned`, there is no validation t
206206
[role=label--enterprise-edition]
207207
[NOTE]
208208
====
209-
The block format is the default format for all newly-created databases as long as they do not have the xref:configuration/configuration-settings.adoc#config_db.format[`db.format`] setting specified.
209+
The block format is the default format for all newly created databases as long as they do not have the xref:configuration/configuration-settings.adoc#config_db.format[`db.format`] setting specified.
210210
For more information on the block format, see xref:database-internals/store-formats.adoc[Store formats].
211211
====
212212

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[[cypher-version-configuration]]
2+
= Configure the Cypher default version
3+
:page-role: new-2025.06
4+
:description: How to configure the Cypher default version.
5+
6+
You can specify the version of Cypher® in which you want to run your queries, choosing between Cypher 5 and Cypher 25.
7+
Cypher 5 is the default version for all newly created databases, however, if you want to take advantage of the new features in Cypher 25, you can set the default version to Cypher 25.
8+
For more information, see xref:introduction.adoc#_cypher_versions[Cypher® versions].
9+
10+
To specify the Cypher version, use one of the following options:
11+
12+
Configure a default Cypher version for the whole DBMS::
13+
The default language version for the whole DBMS can be configured in the _neo4j.conf_ file using the setting xref:configuration/configuration-settings.adoc#config_db.query.default_language[db.query.default_language] (default value: CYPHER_5). +
14+
Changing this setting in an existing DBMS *does not* affect existing databases.
15+
It only applies to newly created databases unless the version is specified as part of the `CREATE` or `ALTER` database commands.
16+
17+
Configure a default Cypher version per database::
18+
The default language for a specific database can be set using a Cypher database administration command with the `SET DEFAULT LANGUAGE` clause when creating the database or by altering the database after it has been created.
19+
This clause determines the default Cypher version for the specified database, overriding the version set in the configuration file.
20+
For example, `CREATE DATABASE mydb SET DEFAULT LANGUAGE CYPHER 25` or `ALTER DATABASE mydb SET DEFAULT LANGUAGE CYPHER 5`.
21+
For more details and examples, see xref:database-administration/syntax.adoc#administration-syntax-database-management[Database management command syntax] and the respective pages in the xref:database-administration/index.adoc[] section. +
22+
If not specified, the default language for the database is set to the default language of the DBMS.
23+
Setting the default language on creation only require the correct `CREATE` privilege.
24+
Modifying the default language for an existing standard database requires the `SET DATABASE DEFAULT LANGUAGE` privilege and for an existing composite database the `ALTER COMPOSITE DATABASE` privilege.
25+
+
26+
[NOTE]
27+
====
28+
Setting the default language to `CYPHER 25` ensures that all queries run on that database will use the version of `Cypher 25` that the database is currently running (unless you prepend your queries with `CYPHER 5`, which overrides this default).
29+
For example, a Neo4j 2025.08 database with default language `Cypher 25` will use `Cypher 25` as it exists in Neo4j 2025.08, including any changes introduced in Neo4j 2025.06, 2025.07, and 2025.08.
30+
31+
Setting the default language to `CYPHER 5` ensures that all queries run on that database will use the version of `Cypher 5` as it existed at the time of the Neo4j 2025.06 release (unless you prepend your queries with `CYPHER 25`, which overrides this default).
32+
Any changes introduced after the 2025.06 release will not affect the semantics of the query.
33+
====
34+
35+
Set the Cypher version on a per-query basis::
36+
The default language for a specific query can be set by prepending the query with the `CYPHER 5` or `CYPHER 25` keyword. +
37+
For example, `CYPHER 25 MATCH (n) RETURN n` or `CYPHER 5 MATCH (n) RETURN n`.
38+
This setting determines the language for the specified query, overriding the default language set in the configuration file and the database.

modules/ROOT/pages/configuration/index.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The topics described are:
88
* xref:configuration/file-locations.adoc[Default file locations] -- An overview of where files are stored in the different Neo4j distributions and the necessary file permissions for running Neo4j.
99
//* <<network-architecture, Network architecture>> -- A visual representation of the Neo4j network architecture.
1010
* xref:configuration/ports.adoc[Ports] -- An overview of the ports relevant to a Neo4j installation.
11+
* xref:configuration/cypher-version-configuration.adoc[Configure the Cypher default version] -- How to configure the Cypher version.
1112
* xref:configuration/connectors.adoc[Configure network connectors] -- How to configure network connectors for Neo4j.
1213
* xref:configuration/set-initial-password.adoc[Set initial password] -- How to set an initial password.
1314
* xref:configuration/neo4j-admin-memrec.adoc[Get initial memory recommendations] -- How to get initial memory recommendations for Neo4j.

modules/ROOT/pages/database-administration/aliases/manage-aliases-composite-databases.adoc

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
= Managing database aliases in composite databases
55

66
Both local and remote database aliases can be created as part of a composite database.
7-
Starting with Neo4j 2025.04, a database alias can also be set as the default database for a composite database.
87

98
////
109
[source, cypher, role=test-setup]
@@ -18,6 +17,12 @@ CREATE DATABASE `perennial-flowers`;
1817
----
1918
////
2019

20+
[NOTE]
21+
====
22+
Starting with Neo4j 2025.06, a database or remote alias can be assigned a default Cypher version.
23+
However, local aliases and aliases in composite databases cannot be assigned a default Cypher version.
24+
Local aliases always get the Cypher version of their target database and aliases in composite databases always get the Cypher version of the composite database.
25+
====
2126

2227
[[manage-aliases-composite-databases-list]]
2328
== List database aliases in composite databases
@@ -153,14 +158,14 @@ SHOW ALIASES FOR DATABASE YIELD *
153158
.Result
154159
[role="queryresult"]
155160
----
156-
+-----------------------------------------------------------------------------------------------------------------------------------+
157-
| name | composite | database | location | url | user | driver | properties |
158-
+-----------------------------------------------------------------------------------------------------------------------------------+
159-
| "garden.flowers" | "garden" | "perennial-flowers" | "local" | NULL | NULL | NULL | {perennial: TRUE} |
160-
| "garden.trees" | "garden" | "updatedtrees" | "remote" | "neo4j+s://location:7687" | "alice" | {} | {treeversion: 2} |
161-
| "library.romance" | "library" | "romance-books" | "remote" | "neo4j+s://location:7687" | "alice" | {} | {} |
162-
| "library.sci-fi" | "library" | "sci-fi-books" | "local" | NULL | NULL | NULL | {} |
163-
+-----------------------------------------------------------------------------------------------------------------------------------+
161+
+-----------------------------------------------------------------------------------------------------------------------------------------------------+
162+
| name | composite | database | location | url | user | driver | defaultLanguage | properties |
163+
+-----------------------------------------------------------------------------------------------------------------------------------------------------+
164+
| "garden.flowers" | "garden" | "perennial-flowers" | "local" | NULL | NULL | NULL | NULL | {perennial: TRUE} |
165+
| "garden.trees" | "garden" | "updatedtrees" | "remote" | "neo4j+s://location:7687" | "alice" | {} | NULL | {treeversion: 2} |
166+
| "library.romance" | "library" | "romance-books" | "remote" | "neo4j+s://location:7687" | "alice" | {} | NULL | {} |
167+
| "library.sci-fi" | "library" | "sci-fi-books" | "local" | NULL | NULL | NULL | NULL | {} |
168+
+-----------------------------------------------------------------------------------------------------------------------------------------------------+
164169
----
165170

166171
[[delete-composite-database-alias]]

0 commit comments

Comments
 (0)