Closed maxsh8x closed 7 years ago
Sounds like an issue with your typescript bindings. Our docs do say that lean() now accepts either a boolean or an object. Please open up an issue here: https://github.com/DefinitelyTyped/DefinitelyTyped
seems like the issue still exists in mongoose v5.4.19
/**
- Sets the lean option.
- Documents returned from queries with the lean option enabled are plain
- javascript objects, not MongooseDocuments. They have no save method,
- getters/setters or other Mongoose magic applied.
- @param bool defaults to true */ lean(bool?: boolean): Query
& QueryHelpers;
lean doesn't support object.
@flyinghawker false: https://github.com/Automattic/mongoose/blob/5e47d8be8b35599e4997d5f2ef88ef19c7853a32/lib/query.js#L1597 . Either way, this isn't a typescript bindings repo, please open an issue there