odatasensenet

How to fetch only count of documents in sensenet by oData query


I have got all document list with all properties by below query

/OData.svc/workspaces/Document?$select=*&metadata=no&query=InTree:/Root/Sites/Default_Site/workspaces/Document%20AND%20TypeIs:File

But I need only count of those documents

By which oData query I can get only count?

Thanks


Solution

  • Use the $count property, in the following format: https://demo.sensenet.com/OData.svc/workspaces/Document/$count

    You can read more information about OData (releated to this question) in this article ('Addressing the count of a collection' section):

    https://community.sensenet.com/docs/odata-rest-api

    Br, maros