Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: global plugins in app.config.mongoose.client #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/mongoose.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不应该为了其中一个常量变成变量,就把所有常量都改为 let

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

说的是👍


// compatibility
if (!client && !clients && url) {
Expand All @@ -18,6 +18,9 @@ module.exports = app => {
options,
};
}
if (client && client.plugins) {
plugins = client.plugins;
}

mongoose.Promise = customPromise ? customPromise : Promise;

Expand Down