• Preparing search index...
  • The search index is not available
Documentation
  • Documentation
  • @sequelize/core
  • decorators-legacy
  • Default

Function Default

  • Default(options): PropertyOrGetterDescriptor
  • The @Default decorator is used to set a default value for an attribute, it is a shortcut for setting the defaultValue option of the Attribute decorator.

    Parameters

    • options: unknown

    Returns PropertyOrGetterDescriptor

    Example

    class User extends Model<InferAttributes<User>, InferCreationAttributes<User>> {
    @Attribute(DataTypes.STRING)
    @Default('John Doe')
    declare firstName: string;
    }
    • Defined in packages/core/src/decorators/legacy/attribute.ts:217

Settings

Member Visibility

Theme

Documentation
  • Loading...

Generated using TypeDoc