Neo4j/Cypher:筛选两个节点之间的边。

huangapple go评论70阅读模式
英文:

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

Neo4j/Cypher:筛选两个节点之间的边。

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)

huangapple
  • 本文由 发表于 2023年6月27日 18:30:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/76563944.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定