I'm learning Neo4j and playing around with the movie graph in a browser. Following a tutorial, I extract a subgraph around Tom Hanks with the following query:
MATCH (a {name: "Tom Hanks"})-[:ACTED_IN]->(m)<-[:DIRECTED]-(d) RETURN a,m,d LIMIT 10;
As expected, this displays a subgraph of Tom Hanks, ten nodes representing movies he acted in, and the directors of each movie. Wanting to know what the subgraph looks like when not limited to 10 movies, I tried running:
MATCH (a {name: "Tom Hanks"})-[:ACTED_IN]->(m)<-[:DIRECTED]-(d) RETURN a,m,d;
For reasons I don't understand, this produces 3 copies of the expected subgraph, as shown below. Can anyone explain why this happens, and what would be the correct command to display the expected graph?