code: function patchMongoose(mongoose) {
    // patch only once
    if (mongoose[pluginSpec]) return false;
  
    var MCP = mongoose.Collection.prototype;
  
    // hook the wrappers of database API
    [
      'aggregate',
      'findOne',
      'find',
      'mapReduce',
      'update',
      'remove',
      'insert',
      'findAndModify',
      'findAndRemove'
    ]
    .forEach(function(method) {
      hookAsync(MCP, method, hooks.collectionHook);
    });
  
    // mark mongoose as patched
    mongoose[pluginSpec] = {
      collectionOpts: {},
      modelHooked: mongoose.model,
      modelByCollection: {}
    };
  
    // hook the model generator
    mongoose.model = hooks.model;
  
    // emit getModel method on Collection
    if (!MCP.getModel) MCP.getModel = hooks.getModel;
  
    return true;
  }
docs: makes given mongoose object affected by this plugin