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

types(models+query): return lean type when passing QueryOptions with lean: true to relevant model functions like find() and findOne() #13721

Merged
merged 1 commit into from Aug 11, 2023

Conversation

vkarpov15
Copy link
Collaborator

Fix #13705

Summary

Make Model.findOne({}, null, { lean: true }) equivalent to Model.findOne({}).lean() in terms of TypeScript return value.

Examples

…h `lean: true` to relevant model functions like `find()` and `findOne()`

Fix #13705
Copy link
Collaborator

@IslandRhythms IslandRhythms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vkarpov15 vkarpov15 added this to the 7.4.3 milestone Aug 11, 2023
@vkarpov15 vkarpov15 merged commit 513340a into master Aug 11, 2023
3 checks passed
@hasezoey hasezoey deleted the vkarpov15/gh-13705 branch August 11, 2023 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typescript: Wrong return type when using lean in different way
3 participants