Skip to content
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

Merged
merged 2 commits into from
May 2, 2024

Conversation

angrykoala
Copy link
Member

This PR updates the documentation for the new Cypher.Pattern syntax introduced in #310

Copy link

changeset-bot bot commented Apr 26, 2024

⚠️ No Changeset found

Latest commit: b9cf473

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Base automatically changed from variables-in-pattern to main April 30, 2024 09:41
@@ -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();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const { cypher, params } = clause.build();

Comment on lines 50 to 51
MATCH(:Movie)
MATCH(:Person)
Copy link
Contributor

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

Comment on lines 165 to 169
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)
Copy link
Contributor

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();
Copy link
Contributor

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() ?

Copy link
Member Author

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 😞

@angrykoala angrykoala merged commit 75beba0 into main May 2, 2024
9 checks passed
@angrykoala angrykoala deleted the variables-in-pattern-docs branch May 2, 2024 12:43
Copy link

sonarcloud bot commented May 2, 2024

Quality Gate Passed Quality Gate passed

Issues
7 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants