type
RawTransform
RawTransform checks or changes one field before input is converted to its Go type. The context supplies surrounding values; the separate value is this field's raw input and may be invalid. Empty means omitted; Present(store.Null()) means explicit null. Return Keep to leave it unchanged, Set or Clear to change this field, or an error to stop. Changing a context snapshot does not change the document.
Full signature
type RawTransform func(
operation.Context,
operation.Value[store.Value],
) (operation.Change[store.Value], error)Related types
ContextContext describes one field callback at its current lifecycle phase. Root, Siblings and Prior are detached, immutable snapshots of field values; document metadata such as ID is available separately on Context. A callback changes its own value only through its return value.
ValueValue carries an optional logical value. Its zero value is empty. For raw input, empty means omitted and Present(store.Null()) means explicit null. For typed scalars, empty is the portable empty state, not a durable absence encoding. T must follow its own ownership contract; this carrier does not deep-clone arbitrary mutable application values.
ValueAn immutable scalar, object, list, or populated document value.
ChangeChange is what a field transform returns: Keep, Set, or Clear. Its zero value means Keep. Clear empties the callback's own logical value; it does not create an external patch command or durable scalar removal representation.