Skip to content

Commit 6c711c2

Browse files
committed
Update docs to v3
1 parent b7bf8e2 commit 6c711c2

File tree

7 files changed

+11
-67
lines changed

7 files changed

+11
-67
lines changed

docs/modules/ROOT/pages/build-configuration.adoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ The method `build` accepts an object with options to configure the build process
1414
[cols="2,1,1,3",options="header"]
1515
|===
1616
| Setting | Type | Default | Description
17-
| `labelOperator` | String | `":"` | Define the default operator to use when using multiple labels in a Pattern. It can be either `:` or `&`
18-
| `cypherVersion` | String | `undefined` | If set, will prepend all queries with a `CYPHER [Version]` statement. The only valid value is `"5"`
17+
| `cypherVersion` | String | `undefined` | If set, will prepend all queries with a `CYPHER [Version]` statement. The possible values are `"5"` and `"25"`
1918
| `prefix` | String | `undefined` | If set, will add a prefix to all variable names. See xref:how-to/customize-cypher.adoc#_build_prefix[Customize Cypher]
2019
| `extraParams` | Object | `{}` | Add the provided parameters to the resulting params object. See xref:variables-and-params/parameters.adoc#_adding_extra_parameters[Parameters]
2120
| `unsafeEscapeOptions` | Object | `{}` | Set of options to disable escaping from generated Cypher. See xref:_unsafe_escape_options[Unsafe escape options]

docs/modules/ROOT/pages/clauses/with.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
:description: This page describes how to create `WITH` clauses.
33
= With
44

5-
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`.
5+
This page describes how to create a link:https://neo4j.com/docs/cypher-manual/current/clauses/with/[`WITH`] clause using the `Cypher.With` class.
66

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[[compatibility]]
2-
:description: This page outlines the compatibility requirements for `@neo4j/cypher-builder` version 2 with Cypher and Node.js.
2+
:description: This page outlines the compatibility requirements for `@neo4j/cypher-builder` version 3 with Cypher and Node.js.
33
= Compatibility
44

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

7-
* 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].
8-
* Compatible with Node.js version 16.0.0 and later.
7+
* 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].
8+
* Compatible with Node.js version 20.0.0 and later.
99
1010
[NOTE]
1111
====
12-
`@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.
12+
If you need to support Neo4j 4, stay with Cypher Builder 2.x, otherwise, xref:migration-guide-3.adoc#migration[migrate to version 3].
1313
====

docs/modules/ROOT/pages/getting-started/installation.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This guide shows how to start using Cypher Builder by setting up a Node.js proje
66

77
== Requirements
88

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

docs/modules/ROOT/pages/how-to/define-cypher-version.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
:description: This page describes how to define the Cypher version to be used in the query.
33
= Define Cypher version
44

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

77

88
[source, cypher]
@@ -13,7 +13,7 @@ RETURN this0
1313
----
1414

1515

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

1818
[source, javascript]
1919
----

docs/modules/ROOT/pages/subqueries/call.adoc

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -83,54 +83,6 @@ CALL (*) {
8383
}
8484
----
8585

86-
[role=label--deprecated]
87-
== `.importWith`
88-
89-
[WARNING]
90-
====
91-
This method is deprecated in favor of <<_variable_scope>>.
92-
====
93-
94-
[WARNING]
95-
====
96-
`importWith` cannot be used if scope variables are defined and will throw an error.
97-
====
98-
99-
100-
To add variables to a `CALL` subquery context, you need to add a `WITH` statement. This can be achieved by using the `.importWith` method.
101-
102-
[source, javascript]
103-
----
104-
const dog = new Cypher.Node();
105-
const person = new Cypher.Node();
106-
107-
const dogName = new Cypher.NamedVariable("dogName");
108-
109-
const subquery = new Cypher.Match(
110-
new Cypher.Pattern(person, { labels: ["Person"] })
111-
.related(new Cypher.Relationship({ type: "HAS_DOG" }))
112-
.to(dog, { labels: ["Dog"] })
113-
).return([dog.property("name"), dogName]);
114-
115-
const clause = new Cypher.Match(new Cypher.Pattern(person, { labels: ["Person"] }))
116-
.call(subquery)
117-
.importWith(person)
118-
.return(dogName);
119-
----
120-
121-
[source, cypher]
122-
----
123-
MATCH (this0:Person)
124-
CALL {
125-
WITH this0
126-
MATCH (this0:Person)-[this1:HAS_DOG]->(this2:Dog)
127-
RETURN this2.name AS dogName
128-
}
129-
RETURN dogName
130-
----
131-
132-
Note how this example uses `.concat` to combine the initial `MATCH` and `CALL` clauses.
133-
13486
== `.inTransactions`
13587

13688
The `.inTransactions` method appends the `IN TRANSACTIONS` modifier to a `CALL` subquery, causing it to link:https://neo4j.com/docs/cypher-manual/current/subqueries/subqueries-in-transactions/[execute in separate transactions]:

docs/modules/ROOT/pages/variables-and-params/lists.adoc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,14 @@ You also need an expression resulting in the original list to create a new list
9898

9999
[source, javascript]
100100
----
101-
const listComprehension = new Cypher.ListComprehension(variable, new Cypher.Literal([1,2]))
101+
const listComprehension = new Cypher.ListComprehension(variable).in(new Cypher.Literal([1,2]))
102102
----
103103

104104
[source, cypher]
105105
----
106106
[var0 IN [1,2]]
107107
----
108108

109-
Alternatively, the original list expression can be passed with the method `.in`:
110-
111-
[source, javascript]
112-
----
113-
const listComprehension = new Cypher.ListComprehension(variable).in(new Cypher.Literal([1,2]))
114-
----
115-
116109
By using the methods `where` and `map`, you can construct the filter and mapping parts of the comprehension:
117110

118111

0 commit comments

Comments
 (0)