Connection.prototype.plugins

Type:
  • «property»

The plugins that will be applied to all models created on this connection.

Example:

  1. const db = mongoose.createConnection('mongodb://localhost:27017/mydb');
  2. db.plugin(() => console.log('Applied'));
  3. db.plugins.length; // 1
  4. db.model('Test', new Schema({})); // Prints "Applied"