Skip to content

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

Open
wants to merge 32 commits into
base: cypher-25
Choose a base branch
from

Conversation

JPryce-Aklundh
Copy link
Collaborator

@JPryce-Aklundh JPryce-Aklundh commented Nov 27, 2024

Operations manual PRs mentioned in this PR:

TODO: Add clarifying note on Additions page

Copy link
Collaborator

@Hunterness Hunterness left a comment

Choose a reason for hiding this comment

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

Should not be a surprise that I have several comments XD

@JPryce-Aklundh JPryce-Aklundh marked this pull request as ready for review February 25, 2025 14:23
.Create a database with Cypher 5 as the default language
[source, cypher]
----
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.

Comment on lines 236 to 237
*Existing user databases:* `CYPHER 5` +
*New user databases default:* `CYPHER 5`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to add something like this for the remote alias case I mentioned on slack (in addition to having a short sentence about it somewhere as we discussed)

Suggested change
*Existing user databases:* `CYPHER 5` +
*New user databases default:* `CYPHER 5`
*Existing user databases:* `CYPHER 5` +
*Existing non-constituent remote database aliases:* `CYPHER 5` +
*New user databases and non-constituent remote database aliases default:* `CYPHER 5`

(if yes, then we should also update the other two rows in the table)


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.

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.
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 **TBC** release (unless a query is prepended with `CYPHER 25`, which overrides this default).
Copy link
Collaborator

Choose a reason for hiding this comment

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

this bit seems more odd when considering CYPHER 5 is the default, it feels more like it's pointing out a difference to the default (probably due to being added to do just that before :P)

@neo4j-docops-agent
Copy link
Collaborator

This PR includes documentation updates
View the updated docs at https://neo4j-docs-cypher-1123.surge.sh

New pages:

Updated pages:

For information about Cypher 5, see the link:https://neo4j.com/docs/cypher-manual/5/introduction/[Cypher 5 Manual].

[NOTE]
Although Cypher 5 queries are currently supported on Neo4j 2025.06+ databases, they will eventually need to be migrated to Cypher 25, as support for Cypher 5 will be discontinued in a future release (anticipated no earlier than two additional server LTS cycles).
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we give a time horizon for when Cypher 5 will be discontinued? Or at least a no earlier than? As we say people are going to have to migrate eventually, it's useful for customers to know by when they need to allocate work to make it happen.

======
=====

Selecting `CYPHER 25` ensures that all queries run on that database 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.06 or later (unless a query is prepended with `CYPHER 5`, which overrides this default).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Selecting `CYPHER 25` ensures that all queries run on that database 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.06 or later (unless a query is prepended with `CYPHER 5`, which overrides this default).
Selecting `CYPHER 25` ensures that all queries run on that database 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.06 or later (unless a query is xref:selection-query-cypher-version[prepended with `CYPHER 5`], which overrides this default).

To select the Cypher version of a query, prepend it with `CYPHER <language version>`.
This selection will override the default language for the database the query is executed against, and allows you to either work with Cypher 25 features in a database that has Cypher 5 as the default language, or to continue running your Cypher 5 queries on a database that has Cypher 25 as the default language.

Queries run with Cypher 5 will eventually need to be updated to Cypher 25 as support for Cypher 5 will be discontinued in the future (anticipated no earlier than two additional server LTS cycles).
Copy link
Contributor

Choose a reason for hiding this comment

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

As above, time horizon.

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.06 or later.

Selecting `CYPHER 5` ensures that the query will be executed using the language as it existed at the time of the Neo4j 2025.05 release.
Any changes introduced after the 2025.05 release will not affect the query.
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this literally mean that no changes at all will go into Cypher 5 after 25 is out? If one takes this too literally it means no bugfixes or any form of improvement. I'd find clearer a rephrasing along the lines of using the language in its LTS form.


For example, APOC 2025.06 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.06 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 2025.05 release.
Copy link
Contributor

Choose a reason for hiding this comment

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

As above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants