Nodes() function returns relationships?

谁都会走 提交于 2019-12-13 18:50:14

问题


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:


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:

Without auto-complete:



来源:https://stackoverflow.com/questions/32981525/nodes-function-returns-relationships

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!