dyna-record
    Preparing search index...

    Type Alias ExactlyOne<T>

    ExactlyOne: {
        [K in keyof T]-?: Required<Pick<T, K>> & Partial<
            Record<Exclude<keyof T, K>, never>,
        >
    }[keyof T]

    Requires exactly one of an object's properties to be present.

    Distributes the way AtLeastOne does, but types the other keys as never rather than leaving them optional, so supplying a second one is an error. That is the difference between a filter, where several comparison operators compose into a range, and a key condition, where DynamoDB has room for one condition on the sort key.

    Type Parameters

    • T