TypeScript Query.prototype.map() Mongoose 6 #11161
Labels
docs
This issue is due to a mistake or omission in the mongoosejs.com documentation
typescript
Types or Types-test related issue / Pull Request
Milestone
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Type definition of Query.prototype.map() stills present, even thought it is no longer part of mongoose 6, at least based on documentation, it also reports
this.productModel.find(...).lean(...).map is not a function
.If the current behavior is a bug, please provide the steps to reproduce.
https://gist.github.com/edgarbs1998/75342511e9cdf8eb4f6f9cdcffa19c19
What is the expected behavior?
I suppose the Query.prototype.map() function has been removed from Mongoose 6 since it no longer on the documentation, if so it should also be removed from types definitions.
However, I used to use it and so I would like to know what is the alternative to transform the query result as I like, and that can be chained as a query helper and not set on the schema, and that runs after any post hook. Well, the question is, what is the replacement for Query.prototype.map().
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node.js: 16.13.0
Mongoose: 6.1.4
MongoDB: 5.0.3
The text was updated successfully, but these errors were encountered: