Get Count
POST
/api/collections/data/fetch/countLast modified:Â 4 months ago
Count Documents in a Collection
Count the number of documents in a collection in your WorqDB Database.
Count Documents in a Collection
You can count the number of documents in a collection in your WorqDB Database.
curl --request POST \
--url https://api.worqhat.com/api/collections/data/add \
--header 'Authorization: Bearer <API KEY>' \
--header 'Content-Type: application/json' \
--data '{
"collection": "Sample collection",
}'
Count Documents in a Collection with a Key Value
You can count the number of documents in a collection in your WorqDB Database in which a key value is Not Null
.
curl --request POST \
--url https://api.worqhat.com/api/collections/data/add \
--header 'Authorization: Bearer <API KEY>' \
--header 'Content-Type: application/json' \
--data '{
"collection": "Sample collection",
"key": "Sample key",
}'
Request
Body Params application/json
collection
stringÂ
required
key
stringÂ
optional
In case you want to count the number of the times the specific key has a not null
value
Example
{
"collection": "datalogs",
"key": "requestBodySize"
}
Request samples
Responses
OK(200)
Bad Request(400)
Record Not Found(404)
HTTP Code:Â 200
Content Type :Â JSONapplication/json
Data Schema
count
integerÂ
required
processingTime
numberÂ
required
processingId
stringÂ
required
Example
{
"count": 30,
"processingTime": 416.513041,
"processingId": "ed90c76a-77de-407c-9642-0f10003d3611"
}
Last modified: 4 months ago