Skip to content
Merged
Changes from 2 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
8514b29
write cypher selection page
JPryce-Aklundh Nov 14, 2024
85f4663
change 2025.01 to 2025.02
JPryce-Aklundh Dec 20, 2024
8b25fa4
change page-version to current in links
JPryce-Aklundh Jan 10, 2025
6a54b9a
2025.03 update and procedures section
JPryce-Aklundh Feb 3, 2025
e1a6900
Merge branch 'cypher-25' into select_version
JPryce-Aklundh Feb 25, 2025
b5b82b4
add config info
JPryce-Aklundh Feb 25, 2025
11e8788
conflict fix
JPryce-Aklundh Feb 25, 2025
5e285b4
Merge branch 'select_version' of https://github.com/JPryce-Aklundh/do…
JPryce-Aklundh Feb 25, 2025
fc023a6
fix links
JPryce-Aklundh Feb 25, 2025
360f226
clarify table
JPryce-Aklundh Feb 25, 2025
3d5f74f
typo in example
stefano-ottolenghi Feb 25, 2025
5b0baa8
ambiguity clearup
JPryce-Aklundh Feb 25, 2025
1b3f808
Merge branch 'select_version' of https://github.com/JPryce-Aklundh/do…
JPryce-Aklundh Feb 25, 2025
7be498c
typos
stefano-ottolenghi Feb 25, 2025
8d44f62
post review edit
JPryce-Aklundh Feb 25, 2025
4b4133b
Merge branch 'select_version' of https://github.com/JPryce-Aklundh/do…
JPryce-Aklundh Feb 25, 2025
034101b
correction
JPryce-Aklundh Feb 26, 2025
b8a9d64
add links to ops manual privilege and update default value
JPryce-Aklundh Feb 26, 2025
66afae4
2025.03 to 2025.04
JPryce-Aklundh Mar 12, 2025
b4f0831
note attempt
JPryce-Aklundh Mar 12, 2025
2bf10cc
conflict fix
JPryce-Aklundh Mar 12, 2025
0dfb4b9
2025.05 update
JPryce-Aklundh Apr 3, 2025
6dc83e8
Merge branch 'cypher-25' into select_version
JPryce-Aklundh Apr 3, 2025
1c72599
merge cypher-25 branch
JPryce-Aklundh Apr 17, 2025
9b847b0
draft update of default language information
JPryce-Aklundh Apr 17, 2025
096d0d3
Merge branch 'select_version' of https://github.com/JPryce-Aklundh/do…
JPryce-Aklundh Apr 17, 2025
40e019d
update
JPryce-Aklundh Apr 17, 2025
11b09df
remove inexplicable underscores
JPryce-Aklundh Apr 17, 2025
4e1bf7d
config setting underscores
JPryce-Aklundh Apr 17, 2025
d463f0d
rewrite
JPryce-Aklundh May 16, 2025
2de872d
restructure
JPryce-Aklundh May 19, 2025
63d64d4
emphasis
JPryce-Aklundh May 19, 2025
e5c3eef
spelling
JPryce-Aklundh May 26, 2025
ee37101
Merge branch 'dev' into select_version
stefano-ottolenghi Jun 17, 2025
57907c5
reword
JPryce-Aklundh Jun 23, 2025
6985f5c
Merge branch 'select_version'
JPryce-Aklundh Jun 23, 2025
1d4701d
query fix
JPryce-Aklundh Jun 23, 2025
cb1a5f0
proper role
JPryce-Aklundh Jun 23, 2025
0de4ff5
Merge branch 'dev' into select_version
JPryce-Aklundh Jun 23, 2025
ca45c21
final
JPryce-Aklundh Jun 23, 2025
1bdf52d
Merge branch 'select_version' of https://github.com/JPryce-Aklundh/do…
JPryce-Aklundh Jun 23, 2025
5e533a9
Merge branch 'dev' into select_version
JPryce-Aklundh Jun 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 23 additions & 22 deletions modules/ROOT/pages/queries/select-version.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand All @@ -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.
Expand Down Expand Up @@ -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]
Expand All @@ -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
Expand All @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have linked back to these sections from the operations manual documentation of these commands. There doesn't seem much point documenting it twice.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all sections related to database administration should go to the Operations manual, and here, we can add just one link.

----

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]
Expand All @@ -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]
Expand All @@ -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"]
|===
Expand All @@ -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:
Expand All @@ -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
| *Existing system database:* `CYPHER 5` +
| *Existing DBMS database:* `CYPHER 5` +
*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` +
*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` +
*New user databases default:* `CYPHER 25`

|===
Expand Down