count()
Count total records in the service.
- Javascript
- Go
- PHP
- API
const { data, error } = await kontenbase.service('posts').count()
Response
Name | Type | Description |
---|---|---|
res.data | object | Response for data |
res.status | number | Response for status code |
res.statusText | string | Response for status message |
res.error | object | Response for error occurred |
note
Count records with filters:
const { data, error } = await kontenbase.service('posts').count({
"name": "Ega",
})
resp, err := client.Service("posts").Count()
Response
Name | Type | Description |
---|---|---|
resp.Data | map[string]interface{} | Response for data |
resp.Status | int | Response for status code |
resp.StatusText | string | Response for status message |
note
Count records with filters:
resp, err := client.Service("posts").Count()
.SetWhere(map[string]interface{}{
"name": "Ega",
})
$res = $kontenbase->service('posts')->count();
Response
Name | Type | Description |
---|---|---|
$res['data'] | object | Response for data |
$res['status'] | integer | Response for status code |
$res['statusText'] | string | Response for status message |
$res['error'] | object | Response for error occurred |
note
Count records with filters:
$res = $kontenbase->service('posts')->count([
'where' => [
'name' => 'Ega'
]
]);
[GET]
https://api.kontenbase.com/query/api/v1/API_KEY/posts/count