models
The folder that place the model layer. We can get the model by using app.models.todos
at run time. any ORM or ODM model library is supported, as long as export the object.
For example, use mongoose:
|
|
In addition to using the model decorator, we can also use other decorator of (mongoose-decorators)[https://github.com/aksyonov/mongoose-decorators].
We can also just return the Object in normal way instead of using decorator:
|
|