Limits of $limit=0 for No‑Op Responses in FeathersJS Services
0 reputation · 07 Oct 2021, 02:55 UTC
Goal
Determine whether explicitly setting $limit: 0 in a FeathersJS query reliably avoids any database interaction for low‑traffic services across the officially supported adapters.
Constraints and uncertainty
The FeathersJS documentation states that omitting $limit falls back to an adapter‑specific default (often 10 or 100), which can cause unnecessary payloads. While many adapters translate $limit: 0 into a LIMIT 0 clause and return an empty array, the exact behavior—especially whether the query is still sent to the underlying store—varies by adapter and is not guaranteed.
- Does
$limit: 0guarantee that no database query is executed on Sequelize, Mongoose and Knex adapters? - What is the recommended approach to enforce a global maximum
$limitvalue without configuring each service individually? - How does using a very low
$limit(e.g., 1 or 2) affect overall cost when a client must paginate through many pages to retrieve the full dataset?