Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
05-07-2020 01:10 PM
Looking to create code for Exercise 3.3 for the below question:
*** Retrieve all people connected with a particular movie.**
Inputted the below code but received an error
MATCH (p:Person)->(:Movie {title:"A League of their Own"}) Return p
What am I doing wrong?
Thank you to anyone who can help
05-08-2020 06:24 PM
Missing a second -
in the rel. —>
vs ->
Can also leave off the arrow to potentially grab relationships that go the other direction. I haven’t touched that dataset in a while so that may not make a difference in the result.
Best of luck!
05-12-2020 12:59 PM
Thank you very much! I will test this out.
05-10-2020 05:27 PM
To clarify, when you only want to capture any relationship, but don't need to know it's type, properties, and you don't need variable-length relationships, and you don't need a variable on it, then two dashes are needed in the pattern:
(p:Person)-->(:Movie {title:"A League of their Own"})
This is because normally you would have something in the middle, such as the relationship type:
(p:Person)-[:ACTED_IN]->(:Movie {title:"A League of their Own"})
So when none of that is needed, everything in the square brackets can be dropped (along with the square brackets themselves) leading you just to the two dashes and direction (provided the direction is needed).
05-12-2020 12:58 PM
Thank you very much for this! I will try these solutions.
All the sessions of the conference are now available online