* WARNING _ Generally Model have at least 1 unique word (not the case for Swit, Notification .....) * # TODO test attributes/xxxx.js : S'il est 'partialPrimaryKey = true' => updatable = false Donc if('partialPrimaryKey = true' && updatable = true ) TEST ERREUR * Reminder: required: true <=> not null not empty string attributes/ at least 1 attribute should be filter = PUBLIC because it is not possible to have PUBLIC = {} (it means all attributes in mongos so we block that case throwing an error in mongo create read readmany) ***** FAQ * slug <=> normal attribute * swit_v <=> virtually populate with an swit_id attribute in model * xxxx_d <=> it is just to remind you of a dynamic field Dynamic fields are added in services it is NEVER stored but recomputed at each request We could use aggegate for this to make only 1 request but it will make the request too complexe. Let's keep it simple for the moment * For cascade delete/update/create -> use prehook in mongoose * We use mongoose.model('swits') in hooks to avoid cycledependency warning. But it will expose the code to cycledependency so make a documentation... It is because we use function of model that can be cycle dependent in hooks.