Skip to content

Commit db449c1

Browse files
corrections
1 parent d20213e commit db449c1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

modules/ROOT/pages/clauses/match.adoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ By applying `--`, a pattern will be matched for a relationship with any directio
148148

149149
.Find connected nodes using an empty relationship pattern
150150
----
151-
MATCH (director {name: 'Oliver Stone'})--(n)
151+
MATCH (:Person {name: 'Oliver Stone'})--(n)
152152
RETURN n AS connectedNodes
153153
----
154154

@@ -167,7 +167,7 @@ The direction of a relationship in a pattern is indicated by arrows: `-->` or `<
167167
.Find all nodes connected to `Oliver Stone` by an outgoing relationship.
168168
[source, cypher]
169169
----
170-
MATCH (:Person {name: 'Oliver Stone'})-->(movie)
170+
MATCH (:Person {name: 'Oliver Stone'})-->(movie:Movie)
171171
RETURN movie.title AS movieTitle
172172
----
173173

@@ -187,7 +187,7 @@ It is possible to introduce a variable to a pattern, either for filtering on rel
187187
.Find the types of an aliased relationship
188188
[source, cypher]
189189
----
190-
MATCH (:Person {name: 'Oliver Stone'})-[r]->(movie)
190+
MATCH (:Person {name: 'Oliver Stone'})-[r]->()
191191
RETURN type(r) AS relType
192192
----
193193

@@ -258,7 +258,7 @@ It is possible to match for a pattern containing one out of several relationship
258258
.Relationship pattern including either `ACTED_IN` or `DIRECTED` relationship types
259259
[source, cypher]
260260
----
261-
MATCH ( {title: 'Wall Street'})<-[:ACTED_IN|DIRECTED]-(person)
261+
MATCH (:Movie {title: 'Wall Street'})<-[:ACTED_IN|DIRECTED]-(person:Person)
262262
RETURN person.name AS person
263263
----
264264

@@ -283,7 +283,7 @@ A graph pattern can contain several relationship patterns.
283283
.Graph pattern including several relationship patterns
284284
[source, cypher]
285285
----
286-
MATCH (charlie {name: 'Charlie Sheen'})-[:ACTED_IN]->(movie)<-[:DIRECTED]-(director)
286+
MATCH (:Person {name: 'Charlie Sheen'})-[:ACTED_IN]->(movie:Movie)<-[:DIRECTED]-(director:Person)
287287
RETURN movie.title AS movieTitle, director.name AS director
288288
----
289289

@@ -467,10 +467,10 @@ RETURN actors.name AS actor, movieCount, collect(movies.title) AS movies
467467
----
468468
<1> The `Person` and `Movie` nodes matched in this step are stored in variables.
469469
which are then passed on to the second row of the query.
470-
<2> The `movie` variable is here implicitly imported by its occurrence in the `count()` function.
470+
<2> The `movies` variable is here implicitly imported by its occurrence in the `count()` function.
471471
The `WITH` clause explicitly imports the `actors` variable.
472472
<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-
<4> The second MATCH clause finds all `Movie` nodes associated with the `Person` nodes currently bound to the `actors` variable.
473+
<4> The second `MATCH` clause finds all `Movie` nodes associated with the `Person` nodes currently bound to the `actors` variable.
474474

475475
[NOTE]
476476
The above query uses the xref:functions/aggregating.adoc#functions-collect[`collect()` function].

0 commit comments

Comments
 (0)