Skip to content
This page View Markdown Open in ChatGPT Open in Claude

limit

limit caps the number of rows in the answer. Without it, get all and the query APIs return every row which matches, so give a limit as soon as a table can grow.

Query param
GET /api/schema/admin/mysql8/inventory/customers?limit=2&sort=customer_id
Body of the query APIs
{ "find": {}, "limit": 2, "sort": "customer_id" }
Answer
{
    "success": true,
    "statusCode": 200,
    "data": [
        { "customer_id": 1, "first_name": "Bob", "last_name": "Lin" },
        { "customer_id": 2, "first_name": "Alice", "last_name": "Page" }
    ]
}
  • A whole number greater than zero.
  • With skip, it pages : skip=(page - 1) * limit.
  • With getTotalCount=true, the answer also says how many rows match in total.
  • Inside a deep item, limit applies to the related rows of each parent : the 5 latest orders of every customer, for example.
  • The streams (get all by stream, query by stream) send big results without a limit and without holding them in memory.