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

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

wants to merge 1 commit into from

Conversation

JayJay1024
Copy link

@JayJay1024 JayJay1024 commented Jul 16, 2019

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change
// {app_root}/config/config.default.js
exports.mongoose = {
  url: 'mongodb://127.0.0.1/example',
  options: {},
  // mongoose global plugins, expected a function or an array of function and options
  plugins: [createdPlugin, [updatedPlugin, pluginOptions]],
};

VS

// recommended
exports.mongoose = {
  client: {
    url: 'mongodb://127.0.0.1/example',
    options: {},
    // mongoose global plugins, expected a function or an array of function and options
    plugins: [createdPlugin, [updatedPlugin, pluginOptions]],
  },
};

@atian25 atian25 requested a review from JasinYip July 17, 2019 06:27
@atian25
Copy link
Member

atian25 commented Jul 17, 2019

need unittest

@JayJay1024
Copy link
Author

unittest

这个测试就只能是把config.default.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;
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.

说的是👍

@atian25 atian25 changed the title fixed: global plugins in app.config.mongoose.client fixe: global plugins in app.config.mongoose.client Aug 8, 2019
@atian25 atian25 changed the title fixe: global plugins in app.config.mongoose.client fix: global plugins in app.config.mongoose.client Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants