Skip to content

Add tips about Cypher 25 features to Cypher 5 manual #1305

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 1 commit into
base: cypher-5
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 15 additions & 0 deletions modules/ROOT/pages/clauses/with.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ For more information, see xref:subqueries/call-subquery.adoc#import-variables[`C
== Bind values to variables

`WITH` can be used to assign the values of expressions to variables.

[TIP]
Cypher 25 introduces the `LET` clause which binds variables to expression results and can allow for a more succinct and readable alternative to `WITH`.
For more information, see link:https://neo4j.com/docs/cypher-manual/25/clauses/let/[Cypher 25 Manual -> `LET`].

In the below query, the value of the `STRING` concatenation expression is bound to a new variable `customerFullName`, and the value from the expression `chocolate.price * (1 - customer.discount)` is bound to `chocolateNetPrice`, both of which are then available in the `RETURN` clause.

.Bind values to variables
Expand Down Expand Up @@ -466,6 +471,11 @@ RETURN p.name AS product,
`WITH` can be followed by the xref:clauses/where.adoc[`WHERE`] subclause to filter results.
Similar to the subclauses used for xref:clauses/with.adoc#ordering-pagination[ordering and pagination], `WHERE` should be understood as part of the result manipulation performed by `WITH` -- not as a standalone clause -- before the results are passed on to subsequent clauses.

[TIP]
Cypher 25 introduces the `FILTER` clause to filter queries.
`FILTER` can be used as a more concise substitute for `WITH * WHERE <predicate>` constructs.
For more information, see link:https://neo4j.com/docs/cypher-manual/25/clauses/filter/[Cypher 25 Manual -> `FILTER`].

.Filter using `WITH` and `WHERE`
[source, cypher]
----
Expand Down Expand Up @@ -520,6 +530,11 @@ RETURN s.name AS supplier,

If a write clause is followed by a read clause, `WITH` must be used as a separator between the two.

[TIP]
Cypher 25 removes the need to use `WITH` as a separator between write and read clauses.
For more information, see link:https://neo4j.com/docs/cypher-manual/25/clauses/with/[Cypher 25 Manual -> `WITH`].


.`WITH` used as a separator between a write clause and a read clause
// tag::clauses_with_combine_write_read[]
[source, cypher]
Expand Down
22 changes: 18 additions & 4 deletions modules/ROOT/pages/introduction/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,27 @@ ifndef::backend-pdf[]
:description: This section provides an introduction to the Cypher query language.
endif::[]

Welcome to the Neo4j Cypher Manual.
Welcome to the Neo4j Cypher Manual.

Cypher is Neo4j’s declarative query language, allowing users to unlock the full potential of property graph databases.
Cypher is Neo4j’s declarative query language, allowing users to unlock the full potential of property graph databases.

The Cypher Manual aims to be as instructive as possible to readers from a variety of backgrounds and professions, such as developers, administrators, and academic researchers.
[NOTE]
====
This manual covers Cypher 5 -- the default language for Neo4j databases.
As of Neo4j, Cypher 5 is in a frozen state.
That is, no new features will be added to it (only bug fixes and performance improvements).
Cypher 25 was released with Neo4j 2025.06.
From this release on, all new Cypher features will be exclusively added to Cypher 25.
For more details, see:

If you are new to Cypher and Neo4j, you can visit the link:{neo4j-docs-base-uri}/getting-started/current/cypher-intro/[Getting Started Guide -> Introduction to Cypher] chapter.
* link:...[Select Cypher versions]
* link:https://neo4j.com/docs/cypher-manual/25/introduction/[Cypher 25 Manual]
* link:https://neo4j.com/docs/cypher-manual/25/deprecations-additions-removals-compatibility/[Cypher 25 Manual -> Deprecations, additions, and compatibility]
====

The Cypher Manual aims to be as instructive as possible to readers from a variety of backgrounds and professions, such as developers, administrators, and academic researchers.

If you are new to Cypher and Neo4j, you can visit the link:{neo4j-docs-base-uri}/getting-started/current/cypher-intro/[Getting Started Guide -> Introduction to Cypher] chapter.
Additionally, https://graphacademy.neo4j.com/[Neo4j GraphAcademy] has a variety of free courses tailored for all levels of experience.

For a reference of all available Cypher features, see the link:{neo4j-docs-base-uri}/cypher-cheat-sheet/current/[Cypher Cheat Sheet].
Expand Down
5 changes: 5 additions & 0 deletions modules/ROOT/pages/patterns/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,10 @@ This chapter includes the following sections:
* xref:patterns/non-linear-patterns.adoc[] - information about equijoins and graph patterns (combined path patterns).
* xref:patterns/reference.adoc[] - a reference for looking up the syntax and semantics of graph pattern matching.

[TIP]
Cypher 25 introduces the ability to specify different match modes.
For more information, see the link:https://neo4j.com/docs/cypher-manual/25/patterns/match-modes/[Cypher 25 Manual -> Match modes].


The model data in the examples used in this chapter are based on the UK national rail network, using https://www.raildeliverygroup.com/our-services/rail-data/fares-timetable-data.html[publicly available datasets].

8 changes: 8 additions & 0 deletions modules/ROOT/pages/queries/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@ It also discusses how to compose combined queries using `UNION`.
* xref:queries/basic.adoc[]
* xref:queries/combined-queries.adoc[]

[TIP]
====
Cypher 25 introduces conditional and sequential queries.
For more information, see the following pages in the Cypher 25 Manual:

* link:https://neo4j.com/docs/cypher-manual/25/queries/composed-queries/conditional-queries/[Conditional queries (`WHEN`)]
* link:https://neo4j.com/docs/cypher-manual/25/queries/composed-queries/sequential-queries/[Sequential queries (`NEXT`)]
====