function

Import

Import each chosen record through Ridu operations.

Arguments

ArgumentTypeDescription
ctxcontext.ContextThe ctx value.
targetTargetThe target value.
sourceExportThe source value.
actor*store.DocumentThe actor value.

Returns

The declared result.

(Result, error)

How it works

Stops on the first failed record and returns the partial Result. IDs maps source collection and source ID to the created Ridu ID. This is a normalized content importer, not automatic Payload project or database compatibility.

Full signature

func Import( ctx context.Context, target Target, source Export, actor *store.Document, ) (Result, error)

Source migration/payload/payload.go:152

Related types

  • Target

    The narrow destination contract used by Import.

  • Export

    A normalized, source-independent Payload export.

  • Document

    A stored document with status and version metadata.

  • Result

    Completed import count and source-to-target ID mapping.