# /count endpoint is not hit on Virtual Collection

**URL:** <https://community.forestadmin.com/t/count-endpoint-is-not-hit-on-virtual-collection/7454>\
**Category:** Help me!\
**Tags:** howtos\
**Created:** [September 16, 2024, 12:57pm UTC](https://community.forestadmin.com/t/count-endpoint-is-not-hit-on-virtual-collection/7454 "2024-09-16T12:57:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pheetah](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/pheetah/32/7333_2.png) [@pheetah](https://community.forestadmin.com/u/pheetah)\
**Post date:** [September 16, 2024, 12:57pm UTC](https://community.forestadmin.com/t/count-endpoint-is-not-hit-on-virtual-collection/7454/1 "2024-09-16T12:57:02Z")

</div>

We have virtual collections on django forest, their data source is not our db but we get the data from requesting a source and print on forest admin. Those are also related with our DB objects, like traditional 1:1 or 1:M relations so we have relationships like haveMany in those collections.

It worked for us for a long time but one problem we face is we can’t paginate those collections and pagination do not work for those.

the pagination bottom liner looks always 1 of 0, all items are listed in one page. Also when I check the server, I saw that /resource/count url was not hit.

How does pagination work, how can I tweak it to hit /count route?

## Observed behavior

/resource/count is not hit.

## Expected behavior

/resource/count should get hit.

---

<div class="post-metadata">

**Author:** ![Alban\_Bertolini](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/alban_bertolini/32/1077_2.png) [@Alban\_Bertolini](https://community.forestadmin.com/u/Alban_Bertolini)\
**Post date:** [September 16, 2024, 1:26pm UTC](https://community.forestadmin.com/t/count-endpoint-is-not-hit-on-virtual-collection/7454/2 "2024-09-16T13:26:50Z")

</div>

Hello  
Can you provide the forestadmin dependencies you use and your project name 🙏?  
Can you tell us if the `count` request is sent from the frontend application? You can open the frontend `console` to check it.  
If you use the legacy agent, do you send the `count` in the metadata like the following [example](https://docs.forestadmin.com/documentation/reference-guide/smart-collections).

`res.send({ ...customerStats, meta: { count: count } });`

---

<div class="post-metadata">

**Author:** ![pheetah](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/pheetah/32/7333_2.png) [@pheetah](https://community.forestadmin.com/u/pheetah)\
**Post date:** [September 16, 2024, 5:33pm UTC](https://community.forestadmin.com/t/count-endpoint-is-not-hit-on-virtual-collection/7454/3 "2024-09-16T17:33:05Z")

</div>

Hi @Alban_Bertolini,

Thank you for reply. I actually spent days to figure it out, even though I read the documentation I apparently skipped that part. I figured out that I wasn’t sending count data in the response.

Thanks!
