Count
Get the amount of records in a collection.
Sometimes it's useful to have the capability to get records amount in the collection without calling the find function. You can pass filter and paging parameters to filter records upfront and get the amount of filtered records. https://docs.codemash.io/api/database/collections/count
Collection name - unique, lowercased, collection name without whitespace. E.g., if your collection title you have entered in the CodeMash dashboard is "Business Trips" then collection name would be "business-trips".
The CodeMash API version used to fetch data from the API. If not specified, the last version will be used. E.g.: v2
Filter cannot be passed as query string, use POST method instead.
A limit on the number of objects to be returned, between 1 and 100.
The number of records to skip before counting
Accept Header
API key of your cluster. Can be passed in a header as X-CM-Cluster.
ID of your project. Can be passed in a header as X-CM-ProjectId.
Specify culture code when your response from the API should be localised. E.g.: en
Success
Success
Sometimes it's useful to have the capability to get records amount in the collection without calling the find function. You can pass filter and paging parameters to filter records upfront and get the amount of filtered records. https://docs.codemash.io/api/database/collections/count
Collection name - unique, lowercased, collection name without whitespace. E.g., if your collection title you have entered in the CodeMash dashboard is "Business Trips" then collection name would be "business-trips".
The CodeMash API version used to fetch data from the API. If not specified, the last version will be used. E.g.: v2
Accept Header
API key of your cluster. Can be passed in a header as X-CM-Cluster.
ID of your project. Can be passed in a header as X-CM-ProjectId.
Specify culture code when your response from the API should be localised. E.g.: en
A query (in JSON format) that specifies which records to count
A limit on the number of objects to be returned, between 1 and 100.
The number of records to skip before counting
Success
Success
Visit our GitHub repo to see more examples:
Try out our API:
Last updated