Function SortKeyAttribute

  • A decorator for designating the field for the sort key on the dynamo table.

    Type Parameters

    • T extends default

      The entity to which the decorator is applied.

    • K extends SortKey

      The type constraint ensuring the field is suitable to be a partition key.

    Parameters

    • Optional props: AttributeOptions

      An optional object of AttributeOptions, providing additional configuration for the sort key attribute, such as custom metadata.

    Returns ((_value, context) => void)

    A class field decorator function that targets and initializes the class's prototype to register the sort key with the ORM's metadata system.

    Usage example:

    class User extends BaseEntity {
    @SortKeyAttribute()
    public sk: SortKey;
    }

    In this example, @SortKeyAttribute decorates the sk field of User, marking it as the entity's sort key.

      • (_value, context): void
      • Parameters

        • _value: undefined
        • context: ClassFieldDecoratorContext<T, K>

        Returns void

Generated using TypeDoc