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
Copy file name to clipboardExpand all lines: modules/ROOT/pages/clauses/match.adoc
+15-14Lines changed: 15 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,8 +86,8 @@ RETURN movie.title
86
86
|===
87
87
88
88
89
-
[[match-label-expressions]]
90
-
=== MATCH using label expressions
89
+
[[match-node-label-expressions]]
90
+
=== MATCH using node label expressions
91
91
92
92
.Node pattern using the `OR` (`|`) label expression
93
93
[source, cypher]
@@ -128,7 +128,7 @@ The above query uses the xref:functions/list.adoc#functions-labels[`labels()`] a
128
128
2+|Rows: 1
129
129
|===
130
130
131
-
For a full list of all label expressions supported by Cypher, see xref:patterns/reference.adoc#label-expressions[Patterns -> Label expressions].
131
+
For a list of all label expressions supported by Cypher, see xref:patterns/reference.adoc#label-expressions[Patterns -> Label expressions].
132
132
133
133
[[find-relationships]]
134
134
== Find relationships
@@ -250,10 +250,10 @@ RETURN actor.name AS actor
250
250
|Rows: 3
251
251
|===
252
252
253
-
[[match-on-multiple-relationship-types]]
254
-
=== Filter on multiple relationship types
253
+
[[match-relationship-type-expressions]]
254
+
=== MATCH using relationship type expressions
255
255
256
-
It is possible to match for a pattern containing one out of several relationship types using the `OR` symbol, `|`.
256
+
It is possible to match a pattern containing one of several relationship types using the `OR` symbol, `|`.
257
257
258
258
.Relationship pattern including either `ACTED_IN` or `DIRECTED` relationship types
259
259
[source, cypher]
@@ -273,7 +273,9 @@ RETURN person.name AS person
273
273
|Rows: 4
274
274
|===
275
275
276
-
As relationships have exactly one type each, `()-[:A&B]->()` will never match a relationship.
276
+
As relationships can only have exactly one type each, `()-[:A&B]->()` will never match a relationship.
277
+
278
+
For a list of all relationship type expressions supported by Cypher, see xref:patterns/reference.adoc#label-expressions[Patterns -> Label expressions].
277
279
278
280
[[multiple-relationships]]
279
281
=== Find multiple relationships
@@ -300,7 +302,7 @@ RETURN movie.title AS movieTitle, director.name AS director
300
302
301
303
The `MATCH` clause is often paired with a `WHERE` sub-clause, which adds predicates to refine the patterns, making them more specific.
302
304
These predicates are part of the pattern itself, not just filters applied after matching.
303
-
Thus, the `WHERE` clause should always be placed with its corresponding `MATCH` clause.
305
+
Thus, always place the `WHERE` clause with its corresponding `MATCH` clause.
304
306
305
307
.Simple `WHERE` predicate
306
308
[source, cypher]
@@ -426,7 +428,7 @@ For more information about how `MATCH` is used to find patterns of varying compl
426
428
427
429
== Multiple MATCH clauses, the WITH clause, and clause composition
428
430
429
-
In Cypher, a query’s behavior is defined by its clauses.
431
+
In Cypher, the behavior of a query is defined by its clauses.
430
432
Each clause takes the current graph state and a table of intermediate results, processes them, and passes the updated graph state and results to the next clause.
431
433
The first clause starts with the graph's initial state and an empty table, while the final clause produces the query's result.
432
434
@@ -453,7 +455,7 @@ RETURN director.name AS director, movie.title AS movieTitle
453
455
454
456
A variable can be implicitly carried over to the following clause by being referenced in another operation.
455
457
A variable can also be explicitly passed to the following clause using the xref:clauses/with.adoc[`WITH`] clause.
456
-
If a variable is neither implicitly nor explicitly carried over to its following clause, it will be discarded and unavailable for reference later in the query.
458
+
If a variable is neither implicitly nor explicitly carried over to its following clause, it will be discarded and is not available for reference later in the query.
457
459
458
460
.Using `WITH` and multiple `MATCH` clauses
459
461
[source, cypher]
@@ -465,11 +467,10 @@ LIMIT 1 // <3>
465
467
MATCH (actors)-[:ACTED_IN]->(movies) // <4>
466
468
RETURN actors.name AS actor, movieCount, collect(movies.title) AS movies
467
469
----
468
-
<1> The `Person` and `Movie` nodes matched in this step are stored in variables.
469
-
which are then passed on to the second row of the query.
470
-
<2> The `movies` variable is here implicitly imported by its occurrence in the `count()` function.
470
+
<1> The `Person` and `Movie` nodes matched in this step are stored in variables, which are then passed on to the second row of the query.
471
+
<2> The `movies` variable is implicitly imported by its occurrence in the `count()` function.
471
472
The `WITH` clause explicitly imports the `actors` variable.
472
-
<3> An xref:clauses/order-by.adoc[`ORDER BY`] clause orders the results by `movieCount` in descending order, ensuring that the `Person` with the highest number of movies appears at the top, and xref:clauses/limit.adoc[`LIMIT] 1` ensures that all other `Person` nodes are discarded.
473
+
<3> An xref:clauses/order-by.adoc[`ORDER BY`] clause orders the results by `movieCount` in descending order, ensuring that the `Person` with the highest number of movies appears at the top, and xref:clauses/limit.adoc[`LIMIT] 1` ensures that all other `Person` nodes are discarded.
473
474
<4> The second `MATCH` clause finds all `Movie` nodes associated with the `Person` nodes currently bound to the `actors` variable.
0 commit comments