method

LocalAPI.Versions

func (local *LocalAPI) Versions( ctx context.Context, collection, id string, actor *store.Document, localeOptions ...LocaleOptions, ) ([]store.Version, error)

Return authorized retained revisions for one versioned document.

Source core/local.go:595

@param ctx
Request context.
@param collection
Versioned collection slug.
@param id
Document ID.
@param actor
Authenticated actor, or nil.
@param localeOptions
Optional locale selection.
@returns
Authorized retained revisions, or an operation error.

Example

go
history, err := app.Local().Versions(ctx, "posts", postID, actor)

Related types

  • LocalAPI

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

  • Document

    A stored document with status and version metadata.

  • LocaleOptions

    Locale selection for one single-document Local API operation.

  • Version

    One retained version snapshot for a document.