You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extend clause composition docs to also include Write-Read conflicts
instead of only Read-Write conflicts
Co-authored-by: Richard Sill <[email protected]>
Copy file name to clipboardExpand all lines: modules/ROOT/pages/clauses/clause-composition.adoc
+99-3Lines changed: 99 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,7 +129,7 @@ In a Cypher query, read and write clauses can take turns.
129
129
The most important aspect of read-write queries is that the state of the graph also changes between clauses.
130
130
131
131
[IMPORTANT]
132
-
A clause can never observe writes made by a later clause.
132
+
A clause can never observe writes made by a later clause, and will observe all writes done by the previous clauses.
133
133
134
134
As of Cypher 25, read and write clauses can be combined in any order.
135
135
That is, a write clause followed by a read clause no longer requires a separating xref:clauses/with.adoc[`WITH`] clause in order for the read clause to observe the changes made by a preceding write clause.
@@ -152,7 +152,7 @@ RETURN f.name AS friendName,
152
152
.Table of intermediate results and state of the graph between read and write clauses
153
153
======
154
154
155
-
Using the same example graph as above, this example shows the table of intermediate results and the state of the graph after each clause for the following query:
155
+
Using the same example graph as above, this example shows the table of intermediate results and the state of the graph after each clause for a query with a read clause before a write clause:
156
156
157
157
[source,cypher, indent=0]
158
158
----
@@ -163,7 +163,7 @@ The query finds all nodes where the `name` property starts with "J"
163
163
and for each such node it creates another node with the `name` property set to "Jay-jay".
164
164
165
165
166
-
.+The table of intermediate results and the state of the graph after each clause+
166
+
.Read-write: The table of intermediate results and the state of the graph after each clause+
@@ -310,6 +310,102 @@ the graph made by the `CREATE`.
310
310
311
311
======
312
312
313
+
.Table of intermediate results and state of the graph between write and read clauses
314
+
======
315
+
On an empty graph, this example shows the table of intermediate results and the state of the graph after each clause for a query with a write clause before a read clause:
316
+
317
+
[source,cypher, indent=0]
318
+
----
319
+
UNWIND ["Max", "Lune"] AS dogName
320
+
CREATE (n:Dog {name: dogName})
321
+
WITH n
322
+
MATCH (d:Dog)
323
+
RETURN COUNT(*)
324
+
----
325
+
This query creates two `Dog` nodes and returns the value `4`.
326
+
327
+
.+Write-read: The table of intermediate results and the state of the graph after each clause+
0 commit comments