-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update documentation with new patterns syntax #332
Conversation
|
@@ -243,8 +237,7 @@ const releasedBefore2000 = Cypher.lt(yearProp, new Cypher.Param(2000)); | |||
const clause = new Cypher.Match(pattern) | |||
.where(Cypher.and(isKeanu, Cypher.or(Cypher.not(titleContainsMatrix), releasedBefore2000))) | |||
.return(titleProp, taglineProp, yearProp, [rolesProperty, "actingRoles"]); | |||
|
|||
const { cypher, params } = clause.build(); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const { cypher, params } = clause.build(); |
MATCH(:Movie) | ||
MATCH(:Person) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You passed the Node in the Pattern above so I believe here it will be printed as this0:Movie
and this1:Person
const pattern = new Cypher.Pattern(person, { labels: ["Person"] }) | ||
.related(actedIn, { type: "ACTED_IN" }) | ||
.to(movie, { labels: ["Movie"] }) | ||
.related(directed, { direction: "undirected", type: "DIRECTED" }) | ||
.to(actor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong indentation
|
||
==== Exact length | ||
|
||
The exact length can be defined by passing a number: | ||
|
||
[source, javascript] | ||
---- | ||
const pattern = new Cypher.Pattern(person).related(actedIn).withLength(3).to(movie); | ||
const pattern = new Cypher.Pattern({}).related(actedIn, { type: "ACTED_IN", length: 3 }).to(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this not even available in the shorter form new Cypher.Pattern()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not until we deprecate the old version to maintain compatibility 😞
|
This PR updates the documentation for the new
Cypher.Pattern
syntax introduced in #310