diff --git a/lib/mongoose.js b/lib/mongoose.js index 336341d..390e731 100644 --- a/lib/mongoose.js +++ b/lib/mongoose.js @@ -9,7 +9,7 @@ const filterURLPassword = require('./filterURLPassword'); let count = 0; module.exports = app => { - const { client, clients, url, options, defaultDB, customPromise, loadModel, plugins } = app.config.mongoose; + let { client, clients, url, options, defaultDB, customPromise, loadModel, plugins } = app.config.mongoose; // compatibility if (!client && !clients && url) { @@ -18,6 +18,9 @@ module.exports = app => { options, }; } + if (client && client.plugins) { + plugins = client.plugins; + } mongoose.Promise = customPromise ? customPromise : Promise;