1
votes

I am new to Neo4j. I have installed version 2.2.5 community edition to my machine. Downloaded sample data set cineasts_12k_movies_50k_actors_2.1.6. Followed the online training, all is good, except one query confused me a little.

match p = shortestPath( 
    (kevin {name:"Kevin Bacon"})-[*]-(keanu {name:"Keanu Reeves"}) 
) return nodes(p)

I was expecting that the returned values would only be the nodes. Reading the manual about nodes() it sounds like it should only return nodes. However I am getting both nodes and relationships in this case. Am I missing something here or is this a defect ?

1

1 Answers

3
votes

If you are seeing relationships in the Neo4j browser you can turn off "Auto-Complete" - look in the bottom right for the toggle. By default relationships between nodes returned in the browser are shown in the visual, even if not returned in the query.

Example

With auto-complete:

enter image description here

Without auto-complete:

enter image description here