# Smart relationship paging problem

**URL:** <https://community.forestadmin.com/t/smart-relationship-paging-problem/285>\
**Category:** Help me!\
**Created:** [May 22, 2020, 7:13pm UTC](https://community.forestadmin.com/t/smart-relationship-paging-problem/285 "2020-05-22T19:13:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Liam\_Cheung](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/liam_cheung/32/140_2.png) [@Liam\_Cheung](https://community.forestadmin.com/u/Liam_Cheung)\
**Post date:** [May 22, 2020, 7:13pm UTC](https://community.forestadmin.com/t/smart-relationship-paging-problem/285/1 "2020-05-22T19:13:35Z")

</div>

I have a many smart relationships but I never had one that returned more than 1 page of records. I do have one now that returns 18 records.

## Expected behavior

Have 2 pages of records, first one with 15 second one with 3

## Actual behavior

Only 15 are returned with 1 page. Can see that the return meta field is set to 15.  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/1X/5a723ec29ebdeacec44dd2799b5b72abc8497f1a.png)

## Failure Logs

When I query the object in the relation directly and filter by the relationship key, forest calls collection/count and I get the correct  
{count: 18}  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/1X/59b89083d4d3044e2473af4b66fa0e63cf28ae1f.png)  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/1X/8c4882672a87b1af01d6182950c9edcf49cbd1fa.png)

## Context

Please provide any relevant information about your setup.

- Package Version: 6.1.4
- Express Version: 4.17.1
- Sequelize Version:
- Database Dialect: Mongooose
- Database Version:
- Project Name:

---

<div class="post-metadata">

**Author:** ![arnaud](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/arnaud/32/32_2.png) [@arnaud](https://community.forestadmin.com/u/arnaud)\
**Post date:** [May 25, 2020, 6:51am UTC](https://community.forestadmin.com/t/smart-relationship-paging-problem/285/2 "2020-05-25T06:51:03Z")

</div>

Hi @Liam_Cheung,

I think this issue comes from your Smart Has Many Relationship controller implementation.  
Did you consider the `page.size` and `page.number` query parameters?

Here is the right link in the documentation to use those parameters properly:  
[https://docs.forestadmin.com/documentation/reference-guide/relationships/create-a-smart-relationship#creating-a-hasmany-smart-relationship](https://docs.forestadmin.com/documentation/reference-guide/relationships/create-a-smart-relationship#creating-a-hasmany-smart-relationship)

Let me know if it does not help.

---

<div class="post-metadata">

**Author:** ![Liam\_Cheung](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/liam_cheung/32/140_2.png) [@Liam\_Cheung](https://community.forestadmin.com/u/Liam_Cheung)\
**Post date:** [May 26, 2020, 3:04pm UTC](https://community.forestadmin.com/t/smart-relationship-paging-problem/285/3 "2020-05-26T15:04:47Z")

</div>

I had not noticed that the documentation for this type has changed. I will implement it this way.
