The model extension file is a JavaScript file where you can extend a model with JavaScript code.
Page Contents

The LoopBack model generator creates a model extension file for each model in the application. The file will be either in the server/models or the common/models directory (depending on whether the model is server-only or defined on both server and client). The file is named model-name.js, where model-name is the model name; for example, customer.json. The model JSON file defines models, relations between models, and access to models.

Use the model extension file to extend your model with custom code. For example, you can register a remote method here.

'use strict';                                                                                            

module.exports = function(ModelName) {
  // Add extension code here
};
~