method
AdminLoadContext.Find
Read one saved document as the current admin user.
Example
post, err := ctx.Find(
"posts",
ctx.RouteParams["document"],
ridu.FindOptions{},
)Arguments
| Argument | Type | Description |
|---|---|---|
collection | string | Collection slug containing the document. |
id | string | ID of the saved document. |
options | FindOptions | Selection and population settings. Identity and locale come from the request. |
Returns
The access-filtered document, or an error such as denied or not found.
(store.Document, 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) Find(
collection,
id string,
options FindOptions,
) (store.Document, error)Related types
AdminLoadContextRead content for the signed-in user while a Go admin loader runs.
FindOptionsProjection, population, authorization, draft, trash, and locale controls for one read.
DocumentA stored document with status and version metadata.