Proposal: Remove Node and Relationship in favor of Variables #293
angrykoala
started this conversation in
General
Replies: 1 comment
-
Alternative to define a Pattern: new Cypher.Pattern({variable: a, labels: ["Person", "Actor"], properties: aProperties})
.related({type: "ACTED_IN", properties: {roles: new Cypher.Param(["neo"])})
.to({variable: b}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Problem
At the moment, labels and types for Pattern matching are attached to the Node and Relationship classes. This approach is not accurate of how it works in Cypher, and causes the following issues:
withoutLabels
Proposed Solution
Define the labels in the Pattern itself and accept plain variables.
For example, the following pattern:
Current way to generate it:
Proposed:
The advantages of this approach:
rel
variable just to apply the typewithoutVariable
,withoutType
andwithoutLabels
in the PatternDeprecation Path
This would be a big breaking change on how the library works, however, the following steps can be taken to help the migration:
Node
andRelationship
classes as sugar syntax for a variable with the labels attachedwithoutVariable
,withoutType
andwithoutLabels
in the Pattern, whilst keeping the current behaviourBeta Was this translation helpful? Give feedback.
All reactions