lean()
conflicts with Map
type returned by InferSchemaType
#13010
Labels
enhancement
This issue is a user-facing general improvement that doesn't fix a bug or add a new feature
typescript
Types or Types-test related issue / Pull Request
Milestone
Prerequisites
Issue
InferSchemaType
returnsMap
type for a field of typeMap
, which is perfectly fine for full queries likeModel.findOne()
, but does not work for lean queriesModel.findOne().lean()
:Possible solution or quick fix is to allow to pass some flag to
lean()
function that will tell to convert plain object to aMap
object:Or maybe even better to use a special plugin for it.
The text was updated successfully, but these errors were encountered: