# Return all paths from one node to another node

**URL:** <https://community.neo4j.com/t/return-all-paths-from-one-node-to-another-node/31570>\
**Category:** Cypher\
**Created:** [January 6, 2021, 12:06am UTC](https://community.neo4j.com/t/return-all-paths-from-one-node-to-another-node/31570 "2021-01-06T00:06:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fruitfulapproac](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/fruitfulapproac/32/2627_2.png) [@fruitfulapproac](https://community.neo4j.com/u/fruitfulapproac)\
**Post date:** [January 6, 2021, 12:06am UTC](https://community.neo4j.com/t/return-all-paths-from-one-node-to-another-node/31570/1 "2021-01-06T00:06:50Z")

</div>

Was wondering how to do this in Cypher.

In a commutative diagram these paths represent equal morphisms.

This method is deprecated:

`MATCH p=(a{LaTeX:"A"})-[r*]->(b{LaTeX:"C"}) RETURN p`

---

<div class="post-metadata">

**Author:** ![tard\_gabriel](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/tard_gabriel/32/28033_2.png) [@tard\_gabriel](https://community.neo4j.com/u/tard_gabriel)\
**Post date:** [January 6, 2021, 12:13am UTC](https://community.neo4j.com/t/return-all-paths-from-one-node-to-another-node/31570/2 "2021-01-06T00:13:30Z")

</div>

MATCH paths = (n1)-[\*]-(n2)  
RETURN paths SKIP x LIMIT 1

Replace x by 0, 1, 2, 3 for each path (query) you want to see on neo4j desktop.

OR

MATCH paths = (n1)-[\*]-(n2)  
RETURN paths

Will return all your paths in the Table tab view.  
_But you will still see all your graph in the Graph tab view_

---

<div class="post-metadata">

**Author:** ![fruitfulapproac](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/fruitfulapproac/32/2627_2.png) [@fruitfulapproac](https://community.neo4j.com/u/fruitfulapproac)\
**Post date:** [January 8, 2021, 4:20am UTC](https://community.neo4j.com/t/return-all-paths-from-one-node-to-another-node/31570/3 "2021-01-08T04:20:53Z")

</div>

You, son, are a gifted genius, thank you! 😃
