Requires the
entities bundle. A project without the entities bundle returns 403 database/tables-not-available. See Bundles.Overview
useFetchManyEntities returns a function that fetches a paginated list of entities with full filtering and sorting support. It keeps no state of its own. For continuous-scroll or load-more list UIs, use useEntityList, which keeps the list and its pagination state, or useFetchManyEntitiesWrapper, which wraps this hook with pagination and sort state.
Usage Example
Parameters
Results per page: a whole number from
1 to 100. Defaults to 10. A larger value is rejected with 400 entity/invalid-query, never lowered to 100.Field to sort by. Options:
"createdAt", "top", "hot", "controversial", or "metadata.<property>" to sort by a metadata field.Sort direction:
"asc" or "desc". Not accepted with "hot" or "controversial", which rank one way only.Sort algorithm type. Options:
"auto", "numeric", "text", "boolean", "timestamp". Used when sorting by a metadata field.Only entities from this source, or
"none" for entities with no source. Left out: any source.Only entities in this space, or
"none" for entities in no space. Left out: any space, or none.Filter by keywords. See Entity List Filters for the full filter schema.
Filter by title content. See Entity List Filters.
Filter by body content. See Entity List Filters.
Filter by attachments data. See Entity List Filters.
Filter by geographic proximity. See Entity List Filters.
Filter by metadata fields. See Entity List Filters.
Filter by effective NSFW status (
entity.nsfw OR its space's nsfwEffective). "include-all" (default) adds no predicate; "exclude" drops effective-NSFW entities; "only" returns only effective-NSFW entities. On projects without the spaces bundle it applies against the entity’s own nsfw flag alone. See Entity NSFW flagging.Populate related fields, as a single value or an array. Accepted values:
"user", "space", "topComments", "saved", "files", "grants".With
"topComments" included: how many top comments per entity. Server default 1, maximum 5. Not sent when include doesn’t contain "topComments".With
"topComments" included: the reaction whose raw count ranks the top comments. Server default "upvote". Not sent when include doesn’t contain "topComments".Returns
Array of entities for the current page. When
spaceReputation is requested, each embedded author carries an added spaceReputation number. See Reputation.
