Page Contents

The following pages are tagged with

TitleExcerpt
ACL REST API The ACL model connects principals to protected resources. The system grants permissions to principals (users or applications, that can be grouped into roles).
Access token REST API The built-in access token model represents the access token that LoopBack creates for an authenticated user.
Accessing related models For related models, LoopBack automatically adds related model methods corresponding to the API routes defined for the relationship.
Adding logic to models There are three ways to add custom application logic to models: Remote methods - REST endpoints mapped to Node functions. Remote hooks - Logic that triggers when a remote method is executed (before or after). Operation hooks - Logic triggered when a model performs create, read, update, and delete operations against a...
Adding remote methods to built-in models To add a remote method to a  built-in model, you can either  extend the model and add the remote method to your new model, or add it in a boot script, as described here by way of example. This example adds a “greet” method the built-in User model....
Application REST API Note: You can use the StrongLoop API Explorer to quickly construct and make requests to a LoopBack app running on the server. If a LoopBack app is running on localhost at port 3000, then by default API Explorer...
Creating model relations Overview of model relations Individual models are easy to understand and work with. But in reality, models are often connected or related. When you build a real-world application with multiple models, you’ll typically need to define relations between models. For example: A customer has many orders and each...
Creating models You can create models with the model generator, by "discovery" from existing an existing database schema, and by instance introspection for non-relational da...
Customizing models Once you’ve created a model with the model generator, you can start customizing it. You can customize it using the command-line tool, by editing the model definition JSON file, and by adding JavaScript code. Customizing a model with the command-line tool Note:...
Defining models Models are at the heart of LoopBack, and represent back-end data sources such as databases or other back-end services (REST, SOAP, and so on).
Discovering models from relational databases Overview LoopBack makes it simple to create models from an existing relational database. This process is called discovery and is supported by the following connectors: Cassandra MySQL Oracle PostgreSQL SQL Server IBM Cloudant IBM DB2 IBM DashDB IBM DB2...
Embedded models and relations LoopBack supports several kinds of embedded relations: embedsOne, embedsMany, embedsMany with belongsTo, and referencesMany.
Model definition JSON file The model JSON file declaratively defines a LoopBack model.
Model hooks Model hooks are deprecated, except for afterInitialize.
PersistedModel REST API PersistedModel is the base class for models connected to persistent data sources such as databases and is also the base class for all built-in models (except...
Relation REST API The built-in Relation model represents a relationship between two models.
Remote methods A remote method is a static method of a model, exposed over a custom REST endpoint.
Role REST API The built-in Role model represents a set of access controls that can apply to a specific user.
User REST API The built-in User model represents an application end-user.