Properties
Usage
These properties configure your model's name and attributes - which will be used to validate your data:
name
(string) - the model nameattributes
(object) - the model attributes- <attributeName>
required
(boolean) - is the attribute required?unique
(boolean) - should the attribute be unique?type
(string) - the attribute type
- <attributeName>
Example
export class InstrumentModel extends Model {
name = 'instruments';
attributes = {
name: {
required: true,
unique: true,
type: AttributeTypes.String
},
type: {
required: true,
type: AttributeTypes.String
}
};
}
Updated about 6 years ago