Skip to content

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)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess we decided not to care about aliases on this page and leave that for the operations manual


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)

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.

@stefano-ottolenghi stefano-ottolenghi changed the base branch from cypher-25 to dev June 17, 2025 08:42
@neo4j-docops-agent
Copy link
Collaborator

neo4j-docops-agent commented Jun 23, 2025

Thanks for the documentation updates.

The preview documentation has now been torn down - reopening this PR will republish it.

@JPryce-Aklundh JPryce-Aklundh merged commit caeeee4 into neo4j:dev Jun 23, 2025
5 checks passed
@JPryce-Aklundh JPryce-Aklundh deleted the select_version branch June 23, 2025 19:22
JPryce-Aklundh added a commit that referenced this pull request Jun 23, 2025
Operations manual PRs mentioned in this PR:

- neo4j/docs-operations#2153
- neo4j/docs-operations#2116

TODO: Add clarifying note on Additions page

---------

Co-authored-by: Stefano Ottolenghi <[email protected]>
JPryce-Aklundh added a commit to JPryce-Aklundh/docs-cypher that referenced this pull request Jun 24, 2025
Operations manual PRs mentioned in this PR:

- neo4j/docs-operations#2153
- neo4j/docs-operations#2116

TODO: Add clarifying note on Additions page

---------

Co-authored-by: Stefano Ottolenghi <[email protected]>
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.

I know this has been merged but I anyway wanted to take a look at what it ended up like before looking at the operations manual one and the additions/deprecations/removal page updates.

And of course I found some things :P It's mainly the two comments around needed privileges that actually needs some updates as at least one of them is straight up lying and one feels incomplete.

To select a default Cypher version when creating 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.

[NOTE]
Setting the default language requires the link:{neo4j-docs-base-uri}/operations-manual/current/authentication-authorization/dbms-administration/#access-control-dbms-administration-database-management[`SET DATABASE DEFAULT LANGUAGE` privilege].
Copy link
Collaborator

Choose a reason for hiding this comment

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

This only applies for the ALTER DATABASE command. For CREATE DATABASE and CREATE COMPOSITE DATABASE commands only the CREATE DATABASE/CREATE COMPOSITE DATABASE privileges are needed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

might not need the note at all since it should only say that to create you need privilege to create, which isn't anything new, in difference to that alter case that has new/separate privileges 🤷

.Cypher 25
[source,cypher]
----
CREATE DATABASE actors DEFAULT LANGUAGE CYPHER 25
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
CREATE DATABASE actors DEFAULT LANGUAGE CYPHER 25
CREATE DATABASE actors SET DEFAULT LANGUAGE CYPHER 25

This is optional, I prefer having the SET 🤷

SET was added as an optional keyword in the Cypher 25 version of CREATE DATABASE (for all sub-clauses) and isn't available in Cypher 5

To alter the default Cypher version on an existing 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]
Altering the default language requires the link:{neo4j-docs-base-uri}/operations-manual/current/authentication-authorization/dbms-administration/#access-control-dbms-administration-database-management[`SET DATABASE DEFAULT LANGUAGE` privilege].
Copy link
Collaborator

Choose a reason for hiding this comment

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

This only applies for standard and system database, for composite databases you'll need the ALTER COMPOSITE DATABASE privilege instead (it doesn't have a lower level privilege like the standard database case does).

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.

I guess we decided not to care about aliases on this page and leave that for the operations manual

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