A LoopBack model represents data in backend systems such as databases, and by default has both Node and REST APIs. Additionally, you can add functionality such as validation rules and business logic to models.
Every LoopBack application has a set of predefined built-in models such as User, Role, and Application. You can extend built-in models to suit your application's needs.
Additionally, you can define your own custom models specific to your application:
- Use the
slc loopback:model
model generator to create cusom models from scratch. See Using the model generator for more information. - Use
Datasource.buildModelFromInstance()
to create dynamic schema-less models for data sources such as SOAP and REST services. See Creating models from unstructured data for more information. - For data sources backed by a relational database, a model typically corresponds to a table. Use model discovery to create static, schema-driven models for database-backed data sources. See Discovering models from relational databases for more information.