method
LocalAPI.Duplicate
func (local *LocalAPI) Duplicate(
ctx context.Context,
collection,
id string,
overrides store.Values,
actor *store.Document,
localeOptions ...LocaleOptions,
) (store.Document, error)Create a document from an access-checked source and apply overrides.
The source must pass read access. The copy then runs create access, duplicate hooks, validation, persistence, and version logic.
Example
copy, err := app.Local().Duplicate(ctx, "posts", sourceID, store.Values{
"title": store.String("Copy of the original"),
}, actor)Related types
LocalAPIIn-process content operations that share the REST authorization and lifecycle pipeline.
ValuesA map of field names to typed values.
DocumentA stored document with status and version metadata.
LocaleOptionsLocale selection for one single-document Local API operation.