Documentation doesn't say that the default value of flattenMaps is different between toObject and toJSON #11213
Labels
docs
This issue is due to a mistake or omission in the mongoosejs.com documentation
Milestone
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.
The text was updated successfully, but these errors were encountered: