Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-25-2021 08:45 AM
I am sure I am doing something simple wrong here, as I am now to neo4j and cypher. I come from an SQL background.
But I for the life of me cannot figure out why issuing this command against the supplied movie sample data it also returns "Rob Reiner" as "directed" in.. ??
MATCH (n:Person)-[ACTED_IN]->(x:Movie {title:"Stand By Me"}) RETURN n
He did indeed have a small part, but as best as I can tell that is not included in the data (just says directed, not ACTED_IN) and the graph (if I tell it to return x,n instead of just n) includes the relationships, and his is indeed a "directed" relationship, not an acted_in relationship.
I'm sooo confused 😞
Solved! Go to Solution.
02-25-2021 09:27 AM
This is easy to get wrong for newbies to Cypher Query Language.
You are missing a colon before the relationship type. What you have is the equivalent to:
MATCH (n:Person)-[]->(x:Movie {title:"Stand By Me"}) RETURN n
which matches ANY relationship. ACTED_IN
is actually a variable name, the way you wrote it!
What you need is:
MATCH (n:Person)-[:ACTED_IN]->(x:Movie {title:"Stand By Me"}) RETURN n
Note :ACTED_IN
and not ACTED_IN
02-25-2021 09:27 AM
This is easy to get wrong for newbies to Cypher Query Language.
You are missing a colon before the relationship type. What you have is the equivalent to:
MATCH (n:Person)-[]->(x:Movie {title:"Stand By Me"}) RETURN n
which matches ANY relationship. ACTED_IN
is actually a variable name, the way you wrote it!
What you need is:
MATCH (n:Person)-[:ACTED_IN]->(x:Movie {title:"Stand By Me"}) RETURN n
Note :ACTED_IN
and not ACTED_IN
02-25-2021 10:10 AM
O, thank you!!!!!!!!
All the sessions of the conference are now available online