Skip to main content

Overview

useFetchManyEntities returns a function that fetches a paginated list of entities with full filtering and sorting support. This is the low-level hook underlying EntityListProvider. For continuous-scroll or load-more list UIs, use useEntityList instead, which wraps this hook with built-in pagination state.

Usage Example

Parameters

number
Page number (1-indexed). Defaults to 1.
number
Results per page. Defaults to server default.
string
Field to sort by. Options: "createdAt", "top", "hot", "controversial", or "metadata.<property>" to sort by a metadata field.
string
Sort by a specific reaction type count. Use with sortBy: "reaction".
string
Sort direction: "asc" or "desc".
string
Sort algorithm type. Options: "auto", "numeric", "text", "boolean", "timestamp". Used when sorting by a metadata field.
string
Filter entities to a time window. Options: "day", "week", "month", "year".
string
Filter to entities associated with a specific source ID.
string
Filter to entities in a specific space.
string
Filter to entities created by a specific user.
boolean
If true, return only entities from users the authenticated user follows.
object
Filter by keywords. See Entity List Filters for the full filter schema.
object
Filter by title content. See Entity List Filters.
object
Filter by body content. See Entity List Filters.
object
Filter by attachments data. See Entity List Filters.
object
Filter by geographic proximity. See Entity List Filters.
object
Filter by metadata fields. See Entity List Filters.
string | string[]
Populate related fields. Accepted values: "user", "space", "topComment", "saved", "files".
string
Resolves each row’s embedded author reputation into a spaceReputation number. Accepts a space <uuid>, "none" (project-general bucket), or "context" (server-derived per row from the request context). Empty string, "general", and null are rejected. See Reputation.
boolean
When true, spaceReputation is the subtree sum (the space plus all its descendants). Only honored when spaceReputationId is an explicit <uuid>.

Returns

Entity[]
Array of entities for the current page. When spaceReputationId is set, each embedded author carries an added spaceReputation number. See Reputation.
number
Current page number.
number
Number of results per page.
number
Total number of pages matching the filters.
number
Total count of entities matching the filters (across all pages).
boolean
true if there are additional pages available.