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

Documentation doesn't say that the default value of flattenMaps is different between toObject and toJSON #11213

Closed
ozomer opened this issue Jan 11, 2022 · 0 comments
Labels
docs This issue is due to a mistake or omission in the mongoosejs.com documentation
Milestone

Comments

@ozomer
Copy link

ozomer commented Jan 11, 2022

Do you want to request a feature or report a bug?

Report a bug

What is the current behavior?

The documentation of Document#toJSON says: "This method accepts the same options as Document#toObject.". However, it does not say that the default value for flattenMaps in toObject is false, but in toJSON it is true:

https://github.com/Automattic/mongoose/blob/master/lib/types/map.js#L133-L161

What is the expected behavior?

Mention this fact in the documentation of toJSON. Would be nice to also mention this fact in the documentation of toObject.

What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.

Mongoose 6.0.14.
NodeJS 16.13.2.

@IslandRhythms IslandRhythms added the docs This issue is due to a mistake or omission in the mongoosejs.com documentation label Jan 11, 2022
@vkarpov15 vkarpov15 added this to the 6.1.9 milestone Jan 15, 2022
@vkarpov15 vkarpov15 modified the milestones: 6.2.2, 6.2.3 Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This issue is due to a mistake or omission in the mongoosejs.com documentation
Projects
None yet
Development

No branches or pull requests

3 participants