Search code examples
neo4jcypher

Neo4j/Cypher: Filter edges between two nodes


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

enter image description here

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!


Solution

  • 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)