Aggregate Count

I am convering an advanced query to an aggregate and I need to use "group by" in order to show correct data and to filter against child data.  However, the "Count" property returned from the aggregate is incorrect.  I have about 150 records and the count returns "2".  I tried using the "length" property but it doesn't include all of the results.  How to I get the count to have the correct value for paging?
Hi Rebecca,

This is an issue with the platform which will probably be solved shortly - until the end of May. Check this previous discussion:

Please explain, what is double-check the role?

one more doubt, how to manage roles at runtime?