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

Related types

  • Context

    Context 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.

  • Value

    Value 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.

  • Value

    An immutable scalar, object, list, or populated document value.

  • Change

    Change 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.