type
ListOptions
Filtering, pagination, projection, population, authorization, and locale controls for a list read.
Properties
| Property | Type | Description |
|---|---|---|
Where | query.Expression | Filter documents atomically with the access predicate. |
Page | int | One-based page; zero selects the first. |
Limit | int | Maximum documents returned per page. |
SkipTotal | bool | SkipTotal skips counting every match, like REST pagination=false. The page then has a nil Total and an exact HasNextPage. |
Sort | []query.Sort | Stable authored-field ordering. |
Select | []query.Path | Restrict returned stored fields. |
Populate | []query.Population | Expand configured relationship paths. |
OutputFields | []query.Path | Limit computed and inverse-join fields independently of Select. |
Draft | *bool | Include drafts when true or require published content when false. |
Actor | *store.Document | Actor used by access rules. |
ActorCollection | schema.CollectionSlug | Exact auth collection owning Actor. |
System | bool | System runs the call as trusted server code: collection, field, draft and reference access rules are skipped. Validation, hooks, versions and reference integrity still apply, and Actor, when set, still reaches hooks. Only Go code can set it; REST and GraphQL never do. |
TrashOnly | bool | List trashed documents only. |
Locale | schema.LocaleCode | Selected content locale. |
FallbackLocales | []schema.LocaleCode | Optional replacement fallback chain. |
DisableFallback | bool | Disable locale fallbacks. |
AllLocales | bool | Return all localized values. |
How it works
The root package re-exports this type as ridu.ListOptions. TrashOnly is valid only for trash-enabled collections.
Full signature
type ListOptions struct {
// Where filters documents before pagination and remains atomic with access predicates.
// Paths with a Read rule on the field or an ancestor are not queryable.
Where query.Expression
// Page is the one-based result page. Zero selects the first page.
Page int
// Limit is the maximum documents returned per page.
Limit int
// SkipTotal skips counting every match, like REST pagination=false. The
// page then has a nil Total and an exact HasNextPage.
SkipTotal bool
// Sort orders results by authored field paths without Read rules on the field or ancestors.
// Container sorts also require all descendants to have no Read rules.
Sort []query.Sort
// Select restricts returned document fields.
Select []query.Path
// Populate expands configured relationship paths.
Populate []query.Population
// OutputFields limits computed and inverse-join resolution without
// projecting away stored fields. Nil resolves all output fields; a non-nil
// empty slice resolves none.
OutputFields []query.Path
// Draft explicitly includes draft documents when true or restricts reads to
// published documents when false. Nil preserves the Local API default.
Draft *bool
// Actor is the authenticated document used by access rules.
Actor *store.Document
// ActorCollection identifies the exact auth collection that owns Actor.
ActorCollection schema.CollectionSlug
// System runs the call as trusted server code: collection, field, draft
// and reference access rules are skipped. Validation, hooks, versions and
// reference integrity still apply, and Actor, when set, still reaches
// hooks. Only Go code can set it; REST and GraphQL never do.
System bool
// TrashOnly returns deleted documents and is valid only for trash-enabled collections.
TrashOnly bool
// Locale selects one configured content locale. Empty uses the application default.
Locale schema.LocaleCode
// FallbackLocales replaces the locale's configured fallback chain when non-nil.
FallbackLocales []schema.LocaleCode
// DisableFallback requires an exact value in Locale.
DisableFallback bool
// AllLocales returns locale-keyed values for localized fields.
AllLocales bool
}