dyna-record
    Preparing search index...

    Type Alias ContainsConditionFor<V>

    ContainsConditionFor: V extends Date
        ? ContainsFilter
        : V extends string
            ? ContainsFilter
            : V extends readonly (infer Element)[]
                ? Record<"$contains", AllowNullInWholeValue<Element>>
                : never

    $contains, offered only where the table stores the attribute in a form contains applies to.

    DynamoDB's contains tests a substring of a String, or membership of a List or a Set. A String-stored attribute — including a date, an enum and a foreign key — takes the substring reading; an array-typed field takes the membership one. A number, a boolean and a Map take neither.

    The two readings take different operands, which is why an array field gets its own branch: a substring is a string, while an element is whatever the list holds — including a Map, for a list of objects. Typing it as the element is what lets the member test keep the field's own type instead of widening to any scalar.

    The element is written as AllowNullInWholeValue describes, which offers null on its nullable fields: contains compares an element whole, and the expression builder leaves a nulled field out of the bound element, as the element is stored.

    Distributes for the same reason BeginsWithConditionFor does.

    Type Parameters

    • V

      The attribute's declared type.