dyna-record
    Preparing search index...

    Interface UpdateOperationOptions<T>

    Options for the static and instance update methods (DynaRecord.update).

    // Cancel an Order only while it is still pending and its Customer is active
    const options: UpdateOperationOptions<Order> = {
    condition: { status: "pending", customer: { status: "active" } }
    };

    await Order.update("order-1", { status: "cancelled" }, options);
    interface UpdateOperationOptions<T extends default = default> {
        condition?: WriteCondition<T>;
        forceEmbed?: boolean;
        referentialIntegrityCheck?: boolean;
    }

    Type Parameters

    Index

    Properties

    condition?: WriteCondition<T>

    A guard on the entity's own row and on its related rows, checked in the same transaction as the update: the entity is updated only if every part holds. A relationship guard still requires its row to exist when referentialIntegrityCheck is false. See WriteCondition.

    forceEmbed?: boolean

    Embed the searchable attribute even when its value appears unchanged. By default an update whose searchable value matches the stored value skips the embedding call and the vector write. Pass true to embed anyway — the affordance for indexing rows that predate searchability (backfills) and for re-embedding after an embedding model change.

    false
    
    referentialIntegrityCheck?: boolean

    Whether to perform referential integrity checks for foreign key references. When true (default), condition checks are added to verify that referenced entities exist. When false, these condition checks are skipped, allowing updates even if foreign key references don't exist.

    true