method

AdminLoadContext.List

Read a filtered page of documents as the current admin user.

Example

go
posts, err := ctx.List("posts", ridu.ListOptions{Limit: 20})

Arguments

ArgumentTypeDescription
collectionstringCollection slug to read.
optionsListOptionsFilters, sort, page size, and population settings. Identity and locale come from the request.

Returns

A page of accessible documents and its matching total, or the read error.

(store.Page, error)

How it works

Uses the normal content operation with the request's permissions, field redaction, hooks, and content locale. Return the error from your loader so the admin can offer retry.

Full signature

func (ctx AdminLoadContext) List( collection string, options ListOptions, ) (store.Page, error)

Source core/admin_loader.go:56

Related types

  • AdminLoadContext

    Read content for the signed-in user while a Go admin loader runs.

  • ListOptions

    Filtering, pagination, projection, population, authorization, and locale controls for a list read.

  • Page

    A paginated result and total count.

Related guides