-
Notifications
You must be signed in to change notification settings - Fork 64
Select Cypher version #1123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Select Cypher version #1123
Changes from 2 commits
8514b29
85f4663
8b25fa4
6a54b9a
e1a6900
b5b82b4
11e8788
5e285b4
fc023a6
360f226
3d5f74f
5b0baa8
1b3f808
7be498c
8d44f62
4b4133b
034101b
b8a9d64
66afae4
b4f0831
2bf10cc
0dfb4b9
6dc83e8
1c72599
9b847b0
096d0d3
40e019d
11b09df
4e1bf7d
d463f0d
2de872d
63d64d4
e5c3eef
ee37101
57907c5
6985f5c
1d4701d
cb1a5f0
0de4ff5
ca45c21
1bdf52d
5e533a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,13 +14,12 @@ Instead, releases from 2025 onwards will follow a *YYYY.MM* format, beginning wi | |
|
|
||
| Cypher 25 is introduced alongside Neo4j 2025.03 and is the default language for newly created databases running version 2025.03 or later. | ||
| However, users running Neo4j version 2025.03 or later can choose to run their queries using the previous version of Cypher: Cypher 5. | ||
| If so, Neo4j will use Cypher as it existed at the time of the Neo4j 5.26 long-term support release. | ||
| If so, Neo4j will use Cypher as it existed at the time of the Neo4j 5.26 long-term support (LTS) release. | ||
|
|
||
| [NOTE] | ||
| Databases migrating to Neo4j 2025.03+ from earlier versions will continue to use Cypher 5 as their default language. | ||
| 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]. | ||
| See also xref:queries/select-version.adoc#config-database-upgrades[Cypher versions, configuration settings, and system upgrades] for information about what default Cypher version is used when upgrading a system. | ||
|
|
||
| See also xref:queries/select-version.adoc#config-database-upgrades[Cypher versions, configuration settings, and DBMS upgrades] for information about what default Cypher version is used when upgrading a DBMS. | ||
|
|
||
| For information about updates to Cypher in different Neo4j versions, see xref:deprecations-additions-removals-compatibility.adoc[]. | ||
| For information about Cypher 5, see the link:https://neo4j.com/docs/cypher-manual/5/introduction/[Cypher 5 Manual]. | ||
|
|
@@ -30,7 +29,7 @@ For information about Cypher 5, see the link:https://neo4j.com/docs/cypher-manua | |
|
|
||
| To select the Cypher version of a query, prepend it with `CYPHER <language version>`. | ||
|
|
||
| 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. | ||
| Selecting `CYPHER 5` ensures that the query will be executed using the language as it existed at the time of the Neo4j 5.26 LTS release. | ||
| Any changes introduced after 5.26 will not affect the query. | ||
|
|
||
| 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. | ||
|
|
@@ -120,7 +119,7 @@ Therefore, procedures and functions in Neo4j 2025.03+ and APOC 2025.03+ (both of | |
|
|
||
| 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. | ||
| 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`. | ||
| In this case, Neo4j will use APOC and Cypher as they existed at the time of the 5.26 long-term support (LTS) release. | ||
| In this case, Neo4j will use APOC and Cypher as they existed at the time of the 5.26 LTS release. | ||
|
|
||
| .Using a procedure removed in Cypher 25 with APOC 2025.03+ | ||
| [source, cypher] | ||
|
|
@@ -146,16 +145,13 @@ RETURN n.name | |
| [[select-default-cypher-version]] | ||
| == Select the default Cypher version when creating a database | ||
|
|
||
| Databases created on Neo4j 2025.03 or later will have Cypher 25 as their default language. | ||
| Databases created on Neo4j 2025.03 or later will have Cypher 25 as their default language (if {neo4j-docs-base-uri}/operations-manual/current/configuration/configuration-settings/#config_db.query.default_language[`config_db.query.default_language`] is set to `CYPHER_25` -- see xref:queries/select-version.adoc#config-database-upgrades[Cypher versions, configuration settings, and DBMS upgrades] below). | ||
| This is true for the link:{neo4j-docs-base-uri}/operations-manual/current/database-administration/#manage-database-systems[system, standard, and composite] Neo4j databases. | ||
|
|
||
| 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. | ||
| This can be done on any Neo4j database. | ||
|
|
||
| [NOTE] | ||
| Selecting a default Cypher version on a database requires the `SET DEFAULT LANGUAGE` privilege. | ||
|
|
||
| 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. | ||
| 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 LTS release (unless a query is prepended with `CYPHER 25`, which overrides this default). | ||
| Any changes introduced after 5.26 will not affect the semantics of the query. | ||
|
|
||
| .Create a database with Cypher 5 as the default language | ||
|
|
@@ -164,7 +160,7 @@ Any changes introduced after 5.26 will not affect the semantics of the query. | |
| CREATE DATABASE my_database DEFAULT LANGUAGE CYPHER 5 | ||
|
||
| ---- | ||
|
|
||
| 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. | ||
| 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 (unless a query is prepended with `CYPHER 5`, which overrides this default). | ||
|
|
||
| .Create a database with Cypher 25 as the default language | ||
| [source, cypher] | ||
|
|
@@ -178,7 +174,7 @@ CREATE DATABASE my_new_database DEFAULT LANGUAGE CYPHER 25 | |
| 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. | ||
|
|
||
| [NOTE] | ||
| Selecting a default Cypher version on a database requires the `SET DEFAULT LANGUAGE` privilege. | ||
| Selecting a default Cypher version on a database requires the `SET DATABASE DEFAULT LANGUAGE` privilege. | ||
|
|
||
| .Set Cypher 5 as the default language on an existing database | ||
| [source, cypher] | ||
|
|
@@ -203,6 +199,11 @@ The Cypher version of a database can be seen using the link:{neo4j-docs-base-uri | |
| SHOW DATABASES YIELD name, defaultLanguage | ||
| ---- | ||
|
|
||
| [NOTE] | ||
| `defaultLanguage` is not returned by default. | ||
| It can only be returned with `YIELD`. | ||
| For more information, see the link:{neo4j-docs-base-uri}/operations-manual/current/database-administration/standard-databases/listing-databases/#_show_databases_output[Operations Manual -> `SHOW DATABASES` output]. | ||
|
|
||
| .Result | ||
| [role="queryresult",options="header,footer",cols="2*<m"] | ||
| |=== | ||
|
|
@@ -216,11 +217,11 @@ SHOW DATABASES YIELD name, defaultLanguage | |
| |=== | ||
|
|
||
| [[config-database-upgrades]] | ||
| == Cypher versions, configuration settings, and system upgrades | ||
| == Cypher versions, configuration settings, and DBMS upgrades | ||
|
|
||
| Changing the Cypher version of a database can also be done with the setting link:{neo4j-docs-base-uri}/operations-manual/current/configuration/configuration-settings/#config_db.query.default_language[`config_db.query.default_language`]. | ||
| Changing the Cypher version of new databases can also be done with the setting link:{neo4j-docs-base-uri}/operations-manual/current/configuration/configuration-settings/#config_db.query.default_language[`config_db.query.default_language`]. | ||
| This setting determines the default language for new databases where it has not been specified as part of a `CREATE` or `ALTER` database command. | ||
| For example, `config_db.query.default_language=CYPHER_25` will set Cypher 25 as the default language for a system. | ||
| For example, `config_db.query.default_language=CYPHER_25` will set Cypher 25 as the default language for a DBMS. | ||
| For more information about using configuration settings, see the link:{neo4j-docs-base-uri}/operations-manual/current/configuration/[Operations Manual -> Configuration]. | ||
|
|
||
| The table below outlines which Cypher version is assigned to databases in different upgrade or installation scenarios: | ||
|
|
@@ -229,21 +230,21 @@ The table below outlines which Cypher version is assigned to databases in differ | |
| |=== | ||
| | Scenario | `db.query.default_language` | Databases | ||
|
|
||
| | *Standard system upgrade to Neo4j 2025.03+* | ||
| | *Standard DBMS upgrade to Neo4j 2025.03+* | ||
| | Unset | ||
Hunterness marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| | *Existing system database:* `CYPHER 5` + | ||
| | *Existing DBMS database:* `CYPHER 5` + | ||
Hunterness marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| *Existing user databases:* `CYPHER 5` + | ||
| *New user databases default:* `CYPHER 5` | ||
|
|
||
| | *Custom system upgrade to Neo4j 2025.03+* | ||
| | Manually set to `CYPHER 25` by administrator | ||
| | *Existing system database:* `CYPHER 5` + | ||
| | *Custom DBMS upgrade to Neo4j 2025.03+* | ||
| | Manually set to `CYPHER_25` by administrator | ||
| | *Existing DBMS database:* `CYPHER 5` + | ||
Hunterness marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| *Existing user databases:* `CYPHER 5` + | ||
| *New user databases default:* `CYPHER 25` | ||
|
|
||
| | *New installation of Neo4j 2025.03+* | ||
| | Set to `CYPHER 25` | ||
| | *New system database:* `CYPHER 25` + | ||
| | Set to `CYPHER_25` | ||
| | *New DBMS database:* `CYPHER 25` + | ||
Hunterness marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| *New user databases default:* `CYPHER 25` | ||
|
|
||
| |=== | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.