LoopBack 3 has reached end of life. We are no longer accepting pull requests or providing support for community users. The only exception is fixes for critical bugs and security vulnerabilities provided as part of support for IBM API Connect customers. We urge all LoopBack 3 users to migrate their applications to LoopBack 4 as soon as possible. Learn more about LoopBack's long term support policy.

Basic model object

Edit this page
Page Contents

Overview

By default, the basic LoopBack Model object has properties and methods "mixed in" from:

When you define relations between models, the RelationMixin object object also gets mixed in to the model object.

Events

Note: The following events are deprecated in favor of operation hooks:

  • changed
  • deleted
  • deletedAll

The following table summarizes the events that LoopBack models can emit. For more information, see Events.

Event Emitted when... Arguments Argument type Class methods that emit Instance methods that emit
'attached' Model is attached to an app. Model class Object app.model(modelName)
'dataSourceAttached' Model is attached to a Data source. Model class Object DataSource.prototype
.createModel
DataSource.prototype
.define
'set' Model property is set. Model instance Object Model.prototype
.setAttributes()

AltStyle によって変換されたページ (->オリジナル) /