-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Avoid id alias globally #10701
Comments
First console log prints an id when it should print undefined |
I took a closer look and you're right, this is a bug. We tried to refactor We'll ship 6.0.7 with this fix on Monday 👍 |
Hi, thanks for the solution, but IMHO I think there should be some kind of order to load plugins, instead of other solutions, at least three sections, something like before, middle (or nothing) and after. Some examples:
For now I've to use the old school filename method to sort the way the plugins are loaded, but I've several layers, so at first my FW plugins are loaded, then the default apps plugins and finally the app plugins, so this kind of sort it's not perfect. Regards. |
The intention of plugins is that order is up to the end developer. The order you call Another way is to modify |
Hi, thanks for the answer, but I'm not able to "sort" manually the plugins, because I develop a framework, so the "plugin" stage is static and independent the framework user, maybe a could add a "position" to the plugin object definition. Regards. |
@chumager so something like |
Hi @vkarpov15, I already thought about that kind of solution as I used in other parts of my code, but the meaning of using inside Mongoose is to help other developers. My plugin objects looks like this: {
plugin(schema, options) {//do something},
schemas: [ ],//optional, could be global
position: x// new, position
} But yes... that's what I'm developing right now. Best regards. |
@chumager how would that work if two plugins have the same |
Hi @vkarpov15 |
Do you want to request a feature or report a bug?
bug
What is the current behavior?
In one of my plugins I've set id
false
to avoid id in all my models, it worked on 5.13.x, but now it's not working in 6.0.xIf the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
I'd like to be able to set id
false
globally, instead of using a plugin. For the moment I need a solution to avoid id alias in my models asSchema.set("id", false);
is not working in a plugin.What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node 16.8.0
Mongoose 6.0.5
Mongodb atlas 4.4.8
The text was updated successfully, but these errors were encountered: