Retrieve the total entities in collections

How can i get the count of users existing inside collection?

0 7 794
7 REPLIES 7

sidd-harth
Participant V

Hi @kiquetal_edgeIf you want to know the number of entities present in a collection you can use the ?limit=1000 parameter and then at the end you can find the count parameter which shows you how many entities are there in the collection.

HTH!

api.usergrid.com/{org}/{app}/{collection}?limit=1000
{
 .....
 "count" : 20 
}

What if there are more than 1000 entries?

If you can access the dashboard in baas you could see the info in /app-overview/summary

I'm trying to use the data in my app is there an api to access the numbers in app-overview or how are those numbers calculated. The only way I can think is looping with cursor and retreiving lists of 1000 until there aren't any more

Could you try to request a simple GET to your app /{org}/{app} ?

That works, returns list of collections and count, but its not immediate, once you delete or add an entity it takes awhile for the collection count to get updated.

That could be a very interesting question for the staff.. when the distributed system is updated....