# Filter edges between two nodes

**URL:** <https://community.neo4j.com/t/filter-edges-between-two-nodes/63061>\
**Category:** Cypher\
**Created:** [June 27, 2023, 10:33am UTC](https://community.neo4j.com/t/filter-edges-between-two-nodes/63061 "2023-06-27T10:33:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kamalika.ray](https://avatars.discourse-cdn.com/v4/letter/k/57b2e6/32.png) [@kamalika.ray](https://community.neo4j.com/u/kamalika.ray)\
**Post date:** [June 27, 2023, 10:33am UTC](https://community.neo4j.com/t/filter-edges-between-two-nodes/63061/1 "2023-06-27T10:33:21Z")

</div>

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.

```auto
MATCH (s:Source {id: 54558})-[r:REL{prop: 8}]->(t:Target)
with s, collect(r) as filterededges, t return s, filterededges, t

```

![Picture2](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/3X/4/c/4c510a31a8f44333d27afdf7676f0000471a9a57.png)

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!

---

<div class="post-metadata">

**Author:** ![Cobra](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/cobra/32/35243_2.png) [@Cobra](https://community.neo4j.com/u/Cobra)\
**Post date:** [June 27, 2023, 11:33am UTC](https://community.neo4j.com/t/filter-edges-between-two-nodes/63061/2 "2023-06-27T11:33:57Z")

</div>

Hello @kamalika.ray and welcome to the Neo4j community 🙂

It's because of the **Connected result nodes** option:

- [Neo4j Browser - Graph Query Results - #2 by koji](https://community.neo4j.com/t/neo4j-browser-graph-query-results/40160/2)
- [Querying nodes with multiple relationships - #5 by dan.flavin\_enterpris](https://community.neo4j.com/t/querying-nodes-with-multiple-relationships/51928/5)
- [Query results different in NEO4J browser versus bloom/neoDash - #2 by giuseppe\_villan](https://community.neo4j.com/t/query-results-different-in-neo4j-browser-versus-bloom-neodash/59839/2)

Best regards,  
Cobra

---

<div class="post-metadata">

**Author:** ![kamalika.ray](https://avatars.discourse-cdn.com/v4/letter/k/57b2e6/32.png) [@kamalika.ray](https://community.neo4j.com/u/kamalika.ray)\
**Post date:** [June 28, 2023, 11:05am UTC](https://community.neo4j.com/t/filter-edges-between-two-nodes/63061/3 "2023-06-28T11:05:39Z")

</div>

Hi Cobra,

Thank you very much! That helped.

Regards,  
Kamalika
