Is there a way to count the number of items on a collection through the API?


#1

According to OData documentation passing $count at the end of the path should return the count of items in a collection or a filtered collection. It doesn’t seem to work in squidex API.


#2

I am not really using odata, I just the filtering because I did not want to write my own parser, therefore not everything is supported.

But you will also receive the total number of items with each response, is this not what you are looking for?


#3

Thanks for the response. I was talking about the total stored count of items in a collection.


#4

This is what total returns. Total >= items.Length, e.g. I use total for pagination.

if you just need the number you could use ?$take=0, so you will receive the total count without any items.