Storage

src/index.js

Storage provides a common interface for defining models. Uses the Waterline ORM.

Instance members

#getModel(id)

Request a model based on its identity (name)

getModel(id)

src/index.js

Request a model based on its identity (name)

Parameters

  • string id :

    The identity of a registered model

Returns

Promise :

The model class

Examples

app.get('storage').getModel('user')
#model(model)

Provide a model

model(model)

src/index.js

Provide a model

Parameters

  • object model :

    A Waterline-compatible model class

Examples

app.get('storage').model(...)

HasModels

src/HasModels.js

The HasModels class is a Base class for defining helper classes with Models.

Instance members

#model_names

Override to define the model names to access

model_names

src/HasModels.js

Override to define the model names to access

Returns

object :

(model identifier: class attribute) pairs

Examples

model_names() { 
return {'user': 'User'}
}