Properties

Usage

These properties configure your model's name and attributes - which will be used to validate your data:

  • name (string) - the model name
  • attributes (object) - the model attributes
    • <attributeName>
      • required (boolean) - is the attribute required?
      • unique (boolean) - should the attribute be unique?
      • type (string) - the attribute type

Example

export class InstrumentModel extends Model {
    name = 'instruments';
    attributes = {
        name: {
            required: true,
            unique: true,
            type: AttributeTypes.String
        },
        type: {
            required: true,
            type: AttributeTypes.String
        }
    };
}