-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
The default value of "minimize" option should be false #8024
Comments
The reason for the minimize option being true is that Mongoose adds // Without minimize, you would always get `nested: {}`
const schema = Schema({ nested: { name: String } }); We'll close this for now because making this change would be very risky and not provide much benefit, but thanks for the suggestion 👍 |
Bumped into this. Perhaps ideally these should not be related? Or rather, the described behavior seems like a defect. In other words, to me neither behaviour is expected - whether it's adding or removing empty subdocuments. |
I think we should reconsider setting @AbdelrahmanHafez @hasezoey do you have any thoughts on this? |
i am partial to this as i have not encountered any problems with the current default ( btw is the statement from 2019 still true?:
|
Yes the 2019 statement is still true. If you have a |
Do you want to request a feature or report a bug?
The Default value of the minimize option should be false.
What is the current behavior?
The default value is true.
If the current behavior is a bug, please provide the steps to reproduce.
This default behavior will remove empty Object without any notice.
What is the expected behavior?
Empty object should remove only when is intented to do so.
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
mongoose 5.6.6
DB 4.0.10
The text was updated successfully, but these errors were encountered: