Methods
(static) new(name, properties, statics, methods, schemaMods) → {Object}
Return new Mongoose model
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of model (in camel case with uppercase first letter e.g. "BlogPost") |
properties |
Object | Mongoose model properties |
statics |
Object | Static methods and properties for new model |
methods |
Object | Instance methods for new model |
schemaMods |
function | Function that receives Schema as parameter and makes modifications to it (e.g. addition of middleware) before model creation |
- Source:
Returns:
Mongoose model
- Type
- Object