英文:
Neo4j/Cypher: Filter edges between two nodes
问题
我想根据边的属性来筛选两个节点之间的边缘。然而,当我使用以下Cypher查询时,只有节点被过滤掉。
MATCH (s:Source {id: 54558})-[r:CCI{prop_1: 8}]->(t:Target)
WITH s, collect(r) AS filterededges, t
RETURN s, filterededges, t
在 "Table" 输出中,它显示了正确的结果(从源节点到目标节点的一条边)。我如何删除显示的不需要的边缘?
我正在使用 Neo4j 版本 5。
非常感谢!
英文:
I want to filter the edges between the two nodes according to the an edge property. However, only the nodes are getting filtered when I use the following Cypher query.
MATCH (s:Source {id: 54558})-[r:CCI{prop_1: 8}]->(t:Target)
with s, collect(r) as filterededges, t return s, filterededges, t
In the "Table" output, it is showing the correct result (one edge from the source node to the target node) How can I remove the unwanted edges that are displayed?
I am using Neo4j version 5.
Thanks a lot!
答案1
得分: 1
你的查询是正确的,这是可视化工具的一个特性。前往设置并取消选中连接结果节点的选项(请参阅https://neo4j.com/docs/browser-manual/current/operations/browser-settings/#adjust-in-browser)。
英文:
Your query is correct and this is an artefact of the visualisation. Go to the settings and un-check the option to connect result nodes (see https://neo4j.com/docs/browser-manual/current/operations/browser-settings/#adjust-in-browser)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论