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 related model methods corresponding to the API routes defined for the relationship.
モデルにロジックを追加する モデルに独自のロジックを追加する方法は3つあります。 リモートメソッド - Node関数に紐付けられたRESTエンドポイントです。 リモートフック - リモートメソッドが実行された時(前または後)に起動できるロジックです。 操作フック - モデルが、データソースに作成・読取・更新・削除の操作を行った時に起動できるロジックです。 独自ロジックのタイミングをさらに改良するには、各メソッドの呼出しを設定します。 いずれの場合でも、LoopBackはロジックを起動する仕組みを提供するだけなので、独自のロジックをコーディングする必要があります。
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...
Attaching models to data sources Models are connected to backend systems via data sources that use data source connectors. You use the model APIs to interact with the model and the data source to which it is attached. Best practice is to first add data sources to your app, as explained in Defining data...
Creating model relations Relations enable you to specify how models are related to each other, with "BelongsTo," "HasOne", and "HasMany" relations, among others.
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...
モデルのカスタマイズ 基本的なモデルを、JSONやJavaScriptを使ってカスタマイズできます。
Defining models Models provide Node and REST APIS for interacting with data sources, performing data validation, and representing relationships among data.
リレーショナルデータベースからモデルを発見する 概要 LoopBack は、既存のリレーショナル・データベースからモデルを作成することが簡単にできます。 この処理は_発見_と呼ばれ、以下のコネクタで使用可能です。 MySQL コネクタ PostgreSQL コネクタ Oracle コネクタ SAP HANA - Not officially supported; see Community connectors. SQL Server コネクタ MongoDBのようなNoSQLデータベースについては、代わりに instance introspectionを使います。 リレーショナルデータベースに接続されたデータソースは、自動的に非同期の~データベース発見APIが使えます。 基本的な手続き 基本的な手続きは以下のとおりです。 アプリケーションで使用するモデルの定義を、スクリプトを実行して発見する。 詳しくは、下の例を参照。 fs.writeFile()を使って、出力を common/models/model-name.json に保存する。...
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. It's in either the server or common project sub-directory, depending on whether the model is ser...
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.
リモートメソッド リモートメソッドは、独自のRESTエンドポイントを通じて公開される、モデルの静的メソッドです。
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.