Sanity Library Reference Docs
    Preparing search index...

    How GuardHelpers.editDocument mutates the document. Each present key becomes one patch op, applied in setunsetinsert order in a single commit; the shapes mirror the client's patch builder.

    type EditDocumentPatch = {
        insert?: {
            anchor: string;
            items: unknown[];
            position: "before" | "after" | "replace";
        };
        set?: Record<string, unknown>;
        unset?: string[];
    }
    Index

    Properties

    Properties

    insert?: {
        anchor: string;
        items: unknown[];
        position: "before" | "after" | "replace";
    }
    set?: Record<string, unknown>
    unset?: string[]