method

LocalAPI.FindWithOptions

func (local *LocalAPI) FindWithOptions( ctx context.Context, collection, id string, options FindOptions, ) (store.Document, error)

Read one document with projection, population, draft, trash, and locale controls.

Source core/local.go:314

@param ctx
Request context.
@param collection
Authored collection slug.
@param id
Document ID.
@param options
Read and response options.
@returns
The authorized and redacted document, or an operation error.

Example

go
post, err := app.Local().FindWithOptions(
  ctx,
  "posts",
  postID,
  ridu.FindOptions{
    Actor:    actor,
    Populate: []query.Population{{Path: authorPath, Depth: 1}},
  },
)

Related types

  • LocalAPI

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

  • FindOptions

    Projection, population, authorization, draft, trash, and locale controls for one read.

  • Document

    A stored document with status and version metadata.