baucis-decorator-update
Upon clients' updates, forces update of properties.
Install
npm install baucis-decorators baucis-decorator-update --save
Usage
Add the decorator and it will add the functionality to any properties containing an update
field as a function.
Example
controllers/Resource.js
var baucis = ;var mongoose = ;var Schema = mongooseSchema;var ObjectId = SchemaTypesObjectId; var ResourceProps = {}; ResourcePropsmodified = type: Date default: Datenow required: true update: Datenow;ResourcePropsmodifiedBy = type: ObjectId ref: 'User' required: true { return reqsessionuserId; }; var ResourceSchema = ResourceProps;var ResourceModel = mongoose;var ResourceController = baucis; var decorators = ;decoratorsadd; /** * Expose controller. */moduleexports = ResourceController;