prorm API Reference
    Preparing search index...

    Interface AntiJoinOptions

    Options for anti-join queries Used to find records that do not have related records

    interface AntiJoinOptions {
        model: ModelStatic<any>;
        as?: string;
        where?: WhereOptions<any>;
        foreignKey?:
            | string
            | string[]
            | { name?: string
            | string[]; allowNull?: boolean };
        targetKey?: string | string[];
        type?: "notIn" | "notExists" | "leftJoinIsNull";
    }
    Index
    model: ModelStatic<any>

    The model to check for absence of related records

    as?: string

    Alias for the included model

    where?: WhereOptions<any>

    WHERE conditions on the related model (must NOT exist for anti-join)

    foreignKey?:
        | string
        | string[]
        | { name?: string
        | string[]; allowNull?: boolean }

    Custom foreign key for the join

    targetKey?: string | string[]

    Target key (defaults to primary key)

    type?: "notIn" | "notExists" | "leftJoinIsNull"

    Type of anti-join to use.

    • 'notExists': Uses NOT EXISTS subquery pattern
    • 'notIn': Uses NOT IN subquery pattern
    • 'leftJoinIsNull': Uses LEFT JOIN WHERE NULL pattern (default)