MCPcopy Index your code
hub / github.com/TanStack/db / limit

Method limit

packages/db/src/query/builder/index.ts:738–743  ·  view source on GitHub ↗

* Limit the number of rows returned by the query * `orderBy` is required for `limit` * * @param count - Maximum number of rows to return * @returns A QueryBuilder with the limit applied * * @example * ```ts * // Get top 5 posts by likes * query * .from({ posts: postsC

(count: number)

Source from the content-addressed store, hash-verified

736 * ```
737 */
738 limit(count: number): QueryBuilder<TContext> {
739 return new BaseQueryBuilder({
740 ...this.query,
741 limit: count,
742 }) as any
743 }
744
745 /**
746 * Skip a number of rows before returning results

Calls

no outgoing calls

Tested by 3

createJoinSubqueryTestsFunction · 0.64
createOrderByTestsFunction · 0.64
createOrderByBugTestsFunction · 0.64