At the moment I've added my pre and path schema extensions in the implementation of a doInit() static function that I call for each document type on node-startup. Is this the way to do it, or is there a better (undocumented) way? If not, could you add something, similar to that for virtuals? E.g.
exports.pre = {
save: function(next) {
}
}
exports.paths = {
theProperty: {
set: function(newValue) {
return ...
}
validate: function(newValue) {
return ...
}
}
}
At the moment I've added my pre and path schema extensions in the implementation of a doInit() static function that I call for each document type on node-startup. Is this the way to do it, or is there a better (undocumented) way? If not, could you add something, similar to that for virtuals? E.g.