Skip to content

Commit e8396fe

Browse files
authored
Or even simpler. Let's switch movie and person.
This will result in a query that makes more sense for the reader. Also there is no need to overcomplicate the example with { direction: "left" }
1 parent 1dcae86 commit e8396fe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ Relationships can be used in a match clause by creating the relevant xref:/patte
4646

4747
[source, javascript]
4848
----
49-
const actedInPattern = new Cypher.Pattern(movieNode, { labels: ["Movie"] })
50-
.related({ type: "ACTED_IN" direction: "left" })
51-
.to(personNode, { labels: ["Person"] });
49+
const actedInPattern = new Cypher.Pattern(personNode, { labels: ["Person"] })
50+
.related({ type: "ACTED_IN" })
51+
.to(movieNode, { labels: ["Movie"] });
5252
5353
const matchQuery = new Cypher.Match(actedInPattern)
5454
----
5555

5656
[source, cypher]
5757
----
58-
MATCH (this0:Movie)<-[:ACTED_IN]-(this1:Person)
58+
MATCH (this0:Person)-[:ACTED_IN]->(this1:Movie)
5959
----
6060

6161
== Filtering with `WHERE`

0 commit comments

Comments
 (0)