I have a plugin in mongoose and for each circuit I do the following
var user = new Schema({});
user.plugin(myplugin);
user.statics.createCustomDoc = function() {
.....
}
The problem is that the createCustomDoc method is also defined in myplugin. Now I want to override createCustomDocmyplugin using the method defined as user.statics.createCustomDoc.
Currently, the method called from the plugin is not the one I wrote in user.statics.createCustomDoc.
How to do it?
Of course, I do not want to change the name of the function, and I do not want to remove the plugin, and I do not want to change the code of the plugin.
source
share