dyna-record
    Preparing search index...

    Type Alias TargetCondition<T>

    TargetCondition: SelfCondition<T> & { $or?: SelfCondition<T>[] }

    A condition on a related entity's row, in the full query-filter vocabulary: equality, IN arrays, $beginsWith, $contains, the comparison operators, $between, $or and dot paths — with null meaning "not set" on a nullable attribute.

    Every guard on another row also requires that row to exist, so an empty condition ({}) is a guard that the row exists.

    It is the value of a BelongsTo or HasOne key in a WriteCondition, of condition in a RelatedEntityCondition, and of target in a ForeignKeyTargetGuard. It names the related entity's own attributes only: a guard cannot reach a further row through the related entity's relationships.

    Type Parameters

    • T extends default

      The related entity whose row the condition is evaluated against.

    Type Declaration

    • Optional$or?: SelfCondition<T>[]

      Condition blocks combined with OR. Each block is a condition on this same row: DynamoDB evaluates a condition against one item, so OR never spans rows.

    // A Customer named Jane, or any Customer whose name starts with "J"
    const customer: TargetCondition<Customer> = {
    $or: [{ name: "Jane" }, { name: { $beginsWith: "J" } }]
    };

    // An active Customer with no phone on file
    const reachable: TargetCondition<Customer> = { status: "active", phone: null };

    // Any existing Customer
    const exists: TargetCondition<Customer> = {};