getTotalCount¶
getTotalCount=true adds totalCount to the answer : the number of rows matching the filter, before skip and limit. One call gives the page and the total.
Query param
GET /api/schema/admin/mysql8/inventory/customers?find={isActive:1}&skip=0&limit=2&getTotalCount=true
Answer
{
"success": true,
"statusCode": 200,
"data": [
{ "customer_id": 1, "first_name": "Bob", "last_name": "Lin" },
{ "customer_id": 2, "first_name": "Alice", "last_name": "Page" }
],
"totalCount": 5
}
falseor absent : nototalCountand no count query.- It works on get all, get all by stream, query and query by stream. The count API gives the number alone.
totalCountalso appears in the answer of a stream, after the rows.- The count runs as a second query on the database ; on a very big table with a complex filter it costs as much as the query itself.