method

LocalAPI.Distinct

Return paginated unique values for one direct field after access checks.

Arguments

ArgumentTypeDescription
ctxcontext.ContextRequest context.
collectionstringAuthored collection slug.
optionsDistinctOptionsField, filter, paging, access, draft, trash, and locale controls.

Returns

Ascending unique values with page metadata, or an operation error.

(store.DistinctPage, error)

How it works

Collection access and Where remain atomic in the adapter query; field read access is checked before values are selected.

Full signature

func (local *LocalAPI) Distinct( ctx context.Context, collection string, options DistinctOptions, ) (store.DistinctPage, error)

Source core/local.go:383

Related types

  • LocalAPI

    In-process content operations that share the REST authorization and lifecycle pipeline.

  • DistinctOptions

    Field, filtering, pagination, authorization, draft, trash, and locale controls for one unique-value read.

  • DistinctPage

    Ascending unique values with ordinary page metadata.