back to query /// home
Count rows matching a filter. Like select but just gives you the number in data field.
{
"action": "count",
"table": "items",
"filter": {
"column": "status",
"op": "=",
"value": "active"
}
}
| Field |
Type |
Required |
Notes |
action |
string |
yes |
must be "count" |
table |
string |
yes |
target table |
where |
object |
no |
simple key value filter |
filter |
object |
no |
structured filter |
joins |
array |
no |
join other tables if needed |
No limit or offset for count, it always counts everything that matches.
{
"success": true,
"data": 42
}
data is just the count as a number.
- should support joins so you can count rows with conditions on related tables
- ownership scoping should apply: if you have
rwo or rwg the count should only include rows you have access to
- you need at least read permission on the table