Skip to content

Commit

Permalink
Add documentation for inTransactions
Browse files Browse the repository at this point in the history
  • Loading branch information
angrykoala committed Mar 19, 2024
1 parent c6c618e commit 0acf69b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/plenty-cycles-do.md
@@ -0,0 +1,5 @@
---
"@neo4j/cypher-builder": patch
---

Add support for `IN TRANSACTIONS` in CALL statements using the method `inTransactions()`
26 changes: 26 additions & 0 deletions docs/modules/ROOT/pages/subqueries/call.adoc
Expand Up @@ -64,3 +64,29 @@ RETURN dogName
----

Note how the previous example uses `.concat` to concatenate the first `MATCH` statement and the `CALL` clause.


== `.inTransactions`

A `CALL` subquery can be executed in separate transactions by using the `inTransaction` method:

[source, javascript]
----
const node = new Cypher.Node();
const match = new Cypher.Match(node);
const deleteSubquery = new Cypher.With(node).detachDelete(node);
const callSubquery=new Cypher.Call(deleteSubquery).inTransactions();
const query = Cypher.concat(match, callSubquery);
----

[source, cypher]
----
MATCH (this0)
CALL {
WITH this0
DETACH DELETE this0
} IN TRANSACTIONS
----

0 comments on commit 0acf69b

Please sign in to comment.