# A very newbie question: how does "LIMIT" in Cypher limit results?

**URL:** <https://community.neo4j.com/t/a-very-newbie-question-how-does-limit-in-cypher-limit-results/60381>\
**Category:** Neo4j Graph Platform\
**Tags:** migrated\
**Created:** [June 16, 2022, 2:02pm UTC](https://community.neo4j.com/t/a-very-newbie-question-how-does-limit-in-cypher-limit-results/60381 "2022-06-16T14:02:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yuxin](https://avatars.discourse-cdn.com/v4/letter/y/c2a13f/32.png) [@yuxin](https://community.neo4j.com/u/yuxin)\
**Post date:** [June 16, 2022, 2:02pm UTC](https://community.neo4j.com/t/a-very-newbie-question-how-does-limit-in-cypher-limit-results/60381/1 "2022-06-16T14:02:04Z")

</div>

Hello, everyone,

I am wondering of the "limit" clause in cypher and I searched its documentation but have not found an explanation yet. How does the "Limit" limit nodes, based on what criteria?

e.g. if I run

match (n) return n limit 10

then 10 nodes will be returned, but why these 10 not other 10? Are they selected based on index or what? I first thought they were randomly picked, but if I rerun the code, the result is the same. Therefore, I this the clause must select the nodes based on certain criteria.

I would appreciate for any explanation and hint. Thanks and Best

---

<div class="post-metadata">

**Author:** ![giuseppe\_villan](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/giuseppe_villan/32/11871_2.png) [@giuseppe\_villan](https://community.neo4j.com/u/giuseppe_villan)\
**Post date:** [June 16, 2022, 3:57pm UTC](https://community.neo4j.com/t/a-very-newbie-question-how-does-limit-in-cypher-limit-results/60381/2 "2022-06-16T15:57:27Z")

</div>

[@yuxin](https://community.neo4j.com/t5/user/viewprofilepage/user-id/14530)

The criteria with which neo4j obtains the result are the internal ids of the nodes and relationships.

In fact, if you create a new database with for example 100 nodes and 50 relationships,  
executing a "match (n) return id(n) limit 5" or a "match ()-[r]-\>() return id(r) limit 5",

the results will always be `0,1,2,3,4`

---

<div class="post-metadata">

**Author:** ![yuxin](https://avatars.discourse-cdn.com/v4/letter/y/c2a13f/32.png) [@yuxin](https://community.neo4j.com/u/yuxin)\
**Post date:** [June 27, 2022, 12:17pm UTC](https://community.neo4j.com/t/a-very-newbie-question-how-does-limit-in-cypher-limit-results/60381/3 "2022-06-27T12:17:11Z")

</div>

Thanks for the explanation! It is clear now 🙂
