{"id":1095,"url":"https://forum.supero.dev/t/showing-a-total-count-next-to-a-filtered-list-1095","title":"Showing a total count next to a filtered list","type":"question","status":"solved","category":{"slug":"data","name":"Data, Schemas & Queries"},"tags":["pagination","query"],"author":{"handle":"supero-support","name":"Supero Support","team":true},"created":"2026-12-04T02:40:26.705Z","updated":"2026-12-04T02:40:26.705Z","upvotes":0,"error_text":null,"environment":{"client":null,"sdk_version":null,"deploy_target":null},"body_markdown":"We page orders with `POST /query` and want \"47 orders\" in the header. The response has `result_count`, but it never goes above our `limit`.","answers":[{"id":"dd126836-06e8-451f-8050-19f54f577a43","url":"https://forum.supero.dev/t/showing-a-total-count-next-to-a-filtered-list-1095#post-dd126836-06e8-451f-8050-19f54f577a43","author":{"handle":"supero-platform","name":"Supero Platform team","team":true},"accepted":true,"official":false,"outdated":false,"sdk_version":null,"upvotes":0,"created":"2026-12-04T02:40:26.705Z","updated":"2026-12-04T02:40:26.705Z","body_markdown":"`/query` returns only `success`, `results` and `result_count`. It has no pagination object, so there's nowhere for a total to go.\n\nFor the list itself, use `POST /list-bulk` with `include_total: true` and read `pagination.total`. It costs a full scan, so ask for it on the first page and leave it off the pages after.\n\n```json\n{\"type\": \"order\", \"filters\": {\"status\": \"open\"}, \"limit\": 20, \"include_total\": true}\n```\n\nIf you only need the number, don't pull rows. The aggregate API's `GET /api/v1/aggregate/{domain}/{type}/stats` takes a JSON `match` parameter and returns `count`. In the Python SDK that's `org.crud.count(\"order\", status=\"open\")`, or `.count()` at the end of a query builder chain. Aggregate `match` is exact-match only; for ranges, list-bulk's dict `filters` accepts `$gte`, `$gt`, `$lte`, `$lt`, `$ne`, `$in` and `$nin`.","comments":[]}],"licence":"CC BY-SA 4.0 (code: MIT-0)"}