Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
3f00fcb
Remove experimental decorators
angrykoala Aug 21, 2025
480fc96
Increase node version to 20
angrykoala Aug 21, 2025
29a03dd
Merge pull request #565 from neo4j/update-node-version
angrykoala Aug 21, 2025
98a4e91
Update GH workflows
angrykoala Aug 21, 2025
9f56213
Remove type Cypher.Operation
angrykoala Jul 17, 2025
b399bb0
Remove method children from concat
angrykoala Jul 17, 2025
9153289
Remove functions deprecated in Cypher 5
angrykoala Jul 17, 2025
c3fc3f4
Remove importWith
angrykoala Aug 21, 2025
1dbc417
Merge branch 'main' into 3-dev
angrykoala Aug 21, 2025
e1f24a4
Merge pull request #567 from neo4j/update-workflows
angrykoala Sep 16, 2025
a4cbaf0
Merge pull request #569 from neo4j/remove-operation
angrykoala Sep 16, 2025
86b7d1e
Merge pull request #571 from neo4j/remove-children
angrykoala Sep 16, 2025
5d4d689
Merge pull request #572 from neo4j/remove-deprecated-functions
angrykoala Sep 16, 2025
315de05
Merge branch '3-dev' into remove-import-with
angrykoala Sep 16, 2025
4e74c1b
Remove support for patterns in size
angrykoala Jul 17, 2025
507934c
Remove extra parameters in Foreach
angrykoala Jul 17, 2025
5d7ef2b
Support for Cypher 25 prefix
angrykoala Aug 21, 2025
9f336ab
Merge branch 'main' into 3-dev
angrykoala Sep 16, 2025
da5977d
Merge pull request #570 from neo4j/remove-foreach-params
angrykoala Sep 23, 2025
f0a27cd
Merge branch 'main' into 3-dev
angrykoala Sep 24, 2025
4ef105e
Rename testing cases from 'it' to 'test'
angrykoala Sep 24, 2025
fa74345
Remove second parameter of listComprehension
angrykoala Sep 24, 2025
117a320
listComprehension in method overrides the expression if called twice
angrykoala Sep 24, 2025
79d5abf
Add example to changelog
angrykoala Oct 13, 2025
f17f316
Merge pull request #585 from neo4j/list-comprehension-in
angrykoala Oct 14, 2025
0fa1d91
Merge remote-tracking branch 'origin/main' into 3-dev
angrykoala Oct 14, 2025
7c47adb
remove labelOperator
angrykoala Oct 14, 2025
2fe15f6
Remove apoc functions and procedures
angrykoala Oct 15, 2025
8495323
Merge pull request #588 from neo4j/remove-label-operator
angrykoala Oct 15, 2025
225e29b
Merge pull request #589 from neo4j/remove-apoc
angrykoala Oct 15, 2025
d55560f
Merge pull request #574 from neo4j/support-25
angrykoala Oct 21, 2025
c568daa
Merge pull request #575 from neo4j/remove-import-with
angrykoala Oct 21, 2025
88a04c9
Merge branch 'main' into 3-dev
angrykoala Oct 22, 2025
b6cd8ca
Fix lint and prettier
angrykoala Oct 22, 2025
56720a2
Add alternative in changelog
angrykoala Oct 22, 2025
f6bec76
Merge pull request #573 from neo4j/remove-patterns-in-size
angrykoala Oct 22, 2025
181d3ef
Merge remote-tracking branch 'origin/main' into 3-dev
angrykoala Oct 23, 2025
74b238b
Merge remote-tracking branch 'origin/main' into 3-dev
angrykoala Oct 28, 2025
e647363
Merge branch 'main' into 3-dev
angrykoala Oct 29, 2025
a49bc98
WIP migration guide for v3
angrykoala Oct 29, 2025
b7bf8e2
Add migration guide for version 3
angrykoala Oct 30, 2025
6c711c2
Update docs to v3
angrykoala Oct 30, 2025
0f794ef
Merge pull request #617 from neo4j/migration-guide-3
angrykoala Nov 3, 2025
48739bc
Merge branch 'main' into 3-dev
angrykoala Nov 3, 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
5 changes: 5 additions & 0 deletions .changeset/all-signs-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@neo4j/cypher-builder": major
---

Remove type `Cypher.Operation` in favor of `Cypher.Expr`
11 changes: 11 additions & 0 deletions .changeset/blue-ends-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@neo4j/cypher-builder": patch
---

Add support for `Cypher 25` version prefix:

```js
const { cypher } = matchQuery.build({
cypherVersion: "25",
});
```
5 changes: 5 additions & 0 deletions .changeset/bright-meals-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@neo4j/cypher-builder": major
---

ListComprehension `.in` method no longer throws if called twice. It will instead override the expression
23 changes: 23 additions & 0 deletions .changeset/clean-items-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
"@neo4j/cypher-builder": major
---

Remove second parameter of `ListComprehension` in favor of `.in`

_Before_

```js
new Cypher.ListComprehension(variable, new Cypher.Literal([1, 2]));
```

_After_

```js
new Cypher.ListComprehension(variable).in(new Cypher.Literal([1, 2]));
```

In both cases, the same comprehension will be generated:

```cypher
[var0 IN [1, 2]]
```
13 changes: 13 additions & 0 deletions .changeset/common-cycles-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"@neo4j/cypher-builder": major
---

Remove support for patterns in size.

_No longer supported_

```js
Cypher.size(new Cypher.Pattern(node));
```

Use `new Cypher.Count(pattern)` instead.
5 changes: 5 additions & 0 deletions .changeset/cool-signs-start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@neo4j/cypher-builder": major
---

Updates minimum node engine to 20.0.0
25 changes: 25 additions & 0 deletions .changeset/easy-horses-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
"@neo4j/cypher-builder": major
---

Remove labelOperator, all labels will now use operator `&`

No longer supported:

```js
const { cypher, params } = matchQuery.build({
labelOperator: "&",
});
```

_Before_

```cypher
MATCH (this1:Movie:Film)
```

_After_

```cypher
MATCH (this1:Movie&Film)
```
30 changes: 30 additions & 0 deletions .changeset/fine-roses-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
"@neo4j/cypher-builder": major
---

Remove all apoc functions and procedures:

- `apoc.util.validate`
- `apoc.util.validatePredicate`
- `apoc.date.convertFormat`
- `apoc.cypher.runFirstColumnMany`
- `apoc.cypher.runFirstColumnSingle`

In order to use apoc methods, create a custom function or procedure. For example:

```js
function validate(
predicate: Predicate,
message: string,
params: List | Literal | Map
): VoidCypherProcedure {
return new VoidCypherProcedure("apoc.util.validate", [predicate, new Literal(message), params]);
}
```

```js
function validatePredicate(predicate: Predicate, message: string): CypherFunction {
return new CypherFunction("apoc.util.validatePredicate", [predicate, new Literal(message), new Literal([0])]);
}

```
10 changes: 10 additions & 0 deletions .changeset/floppy-llamas-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@neo4j/cypher-builder": major
---

Remove method `.children` from concat clauses:

```js
const query = Cypher.utils.concat(clause1, clause2);
query.children; // No longer supported
```
30 changes: 30 additions & 0 deletions .changeset/sharp-women-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
"@neo4j/cypher-builder": major
---

Remove `.importWith` from `Call` clauses in favor of constructor options

_Before_

```js
const clause = new Cypher.Call(nestedClause).importWith(movieNode, actorNode);
```

```cypher
CALL {
WITH var0, var1
// Nested clause
}
```

_After_

```js
const clause = new Cypher.Call(nestedClause, [movieNode, actorNode]);
```

```cypher
CALL (var0, var1){
// Nested clause
}
```
8 changes: 8 additions & 0 deletions .changeset/thin-radios-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@neo4j/cypher-builder": major
---

Remove functions deprecated in Cypher 5:

- `distance` in favor of `point.distance`
- `id` in favor of `elementId`
45 changes: 45 additions & 0 deletions .changeset/violet-sloths-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
"@neo4j/cypher-builder": major
---

Remove extra parameters in `Cypher.Foreach` in favor of methods `in` and `do`.

For example, to create the following Cypher:

```cypher
FOREACH (var0 IN [1, 2, 3] |
CREATE (this1:Movie)
SET
this1.id = var0
)
```

_before_

```js
const list = new Cypher.Literal([1, 2, 3]);
const variable = new Cypher.Variable();

const movieNode = new Cypher.Node();
const createMovie = new Cypher.Create(new Cypher.Pattern(movieNode, { labels: ["Movie"] })).set([
movieNode.property("id"),
variable,
]);

const foreachClause = new Cypher.Foreach(variable, list, createMovie);
```

_after_

```js
const list = new Cypher.Literal([1, 2, 3]);
const variable = new Cypher.Variable();

const movieNode = new Cypher.Node();
const createMovie = new Cypher.Create(new Cypher.Pattern(movieNode, { labels: ["Movie"] })).set([
movieNode.property("id"),
variable,
]);

const foreachClause = new Cypher.Foreach(variable).in(list).do(createMovie);
```
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [16.x, latest]
node-version: [20.x, latest]

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/content-nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@
** xref:how-to/update-labels.adoc[]
** xref:how-to/define-cypher-version.adoc[]
* xref:compatibility.adoc[]
* xref:migration-guide-2.adoc[]
* xref:migration-guide-3.adoc[]
* link:https://github.com/neo4j/cypher-builder/tree/main/examples[Examples]
* link:https://neo4j.github.io/cypher-builder/reference/[Reference]
3 changes: 1 addition & 2 deletions docs/modules/ROOT/pages/build-configuration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ The method `build` accepts an object with options to configure the build process
[cols="2,1,1,3",options="header"]
|===
| Setting | Type | Default | Description
| `labelOperator` | String | `":"` | Define the default operator to use when using multiple labels in a Pattern. It can be either `:` or `&`
| `cypherVersion` | String | `undefined` | If set, will prepend all queries with a `CYPHER [Version]` statement. The only valid value is `"5"`
| `cypherVersion` | String | `undefined` | If set, will prepend all queries with a `CYPHER [Version]` statement. The possible values are `"5"` and `"25"`
| `prefix` | String | `undefined` | If set, will add a prefix to all variable names. See xref:how-to/customize-cypher.adoc#_build_prefix[Customize Cypher]
| `extraParams` | Object | `{}` | Add the provided parameters to the resulting params object. See xref:variables-and-params/parameters.adoc#_adding_extra_parameters[Parameters]
| `unsafeEscapeOptions` | Object | `{}` | Set of options to disable escaping from generated Cypher. See xref:_unsafe_escape_options[Unsafe escape options]
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/clauses/with.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
:description: This page describes how to create `WITH` clauses.
= With

This page describes how to create a link:https://neo4j.com/docs/cypher-manual/current/clauses/with/[`WITH`] clause using the `Cypher.With` class. Note that this is different to the xref:../subqueries/call.adoc#_importwith[ImportWith] statement inside `CALL`.
This page describes how to create a link:https://neo4j.com/docs/cypher-manual/current/clauses/with/[`WITH`] clause using the `Cypher.With` class.

A `With` clause will take multiple parameters. Variables can be passed directly without aliasing:

Expand Down
10 changes: 5 additions & 5 deletions docs/modules/ROOT/pages/compatibility.adoc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[[compatibility]]
:description: This page outlines the compatibility requirements for `@neo4j/cypher-builder` version 2 with Cypher and Node.js.
:description: This page outlines the compatibility requirements for `@neo4j/cypher-builder` version 3 with Cypher and Node.js.
= Compatibility

This page outlines the compatibility requirements for `@neo4j/cypher-builder` version 2 with Cypher and Node.js.
This page outlines the compatibility requirements for `@neo4j/cypher-builder` version 3 with Cypher and Node.js.

* Targets link:https://neo4j.com/docs/cypher-manual/5/introduction/[Cypher 5], with support for link:https://neo4j.com/docs/cypher-manual/4.4/introduction/[Cypher 4.4].
* Compatible with Node.js version 16.0.0 and later.
* Targets link:https://neo4j.com/docs/cypher-manual/25/introduction/[Cypher 25], with support for link:https://neo4j.com/docs/cypher-manual/5/introduction/[Cypher 5].
* Compatible with Node.js version 20.0.0 and later.

[NOTE]
====
`@neo4j/cypher-builder` version 1 is no longer supported. Version 2 is a full replacement and maintains the same compatibility with Cypher and Node.js.
If you need to support Neo4j 4, stay with Cypher Builder 2.x, otherwise, xref:migration-guide-3.adoc#migration[migrate to version 3].
====
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/getting-started/installation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This guide shows how to start using Cypher Builder by setting up a Node.js proje

== Requirements

* link:https://nodejs.org/[Node.js] 16.0.0 or greater
* link:https://nodejs.org/[Node.js] 20.0.0 or greater
* link:https://docs.npmjs.com/downloading-and-installing-node-js-and-npm[npm]
* **[Optional]** A link:https://neo4j.com/cloud/platform/aura-graph-database/?ref=nav-get-started-cta[Neo4j] database to try Cypher queries.

Expand Down
4 changes: 2 additions & 2 deletions docs/modules/ROOT/pages/how-to/define-cypher-version.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
:description: This page describes how to define the Cypher version to be used in the query.
= Define Cypher version

It is possible to define the version of Cypher to use in a query by prepending that query with `CYPHER [version]`. For example:
It is possible to explicitly define the version of Cypher to use in a query by prepending that query with `CYPHER [version]`. For example:


[source, cypher]
Expand All @@ -13,7 +13,7 @@ RETURN this0
----


To add the Cypher version at the beggining of the query, pass the parameter `cypherVersion` to `.build`:
To add the Cypher version at the beggining of the query, pass the parameter `cypherVersion` to `.build`. The possible values are `"5"` and `"25"`:

[source, javascript]
----
Expand Down
Loading
Loading