dyna-record
    Preparing search index...

    Type Alias BeginsWithConditionFor<V>

    BeginsWithConditionFor: V extends Date
        ? BeginsWithFilter
        : V extends string | Uint8Array ? BeginsWithFilter : never

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

    DynamoDB's begins_with takes a String or a Binary attribute. The stored form decides, not the declared one, which is why a date attribute keeps it: declared Date, stored as an ISO string, and matching a date by year prefix is what the operator is for there. A number, a boolean, a Map or a List has no prefix, so begins_with on one matches nothing and DynamoDB reports no error — the condition is better removed from the type than compiled.

    Each branch tests V directly so the conditional distributes. That matters for a value whose type is a union: an unresolved dot path takes the whole scalar union, which includes string, and stays unconstrained — the behavior such a path has always had. Testing a mapped form of V instead would compare the union as a whole and drop the operator from every one.

    Type Parameters

    • V

      The attribute's declared type.