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(query): make lean() flatten out inferred maps into Record<string, V> #13326

Merged
merged 1 commit into from Apr 25, 2023

Conversation

vkarpov15
Copy link
Collaborator

Fix #13010

Summary

lean() queries never return maps, because Mongoose maps are stored as POJOs in MongoDB. This PR makes so that lean() uses FlattenMaps by default to replace maps in documents with their Record<> equivalent.

Examples

Copy link
Collaborator

@hasezoey hasezoey left a comment

Choose a reason for hiding this comment

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

LGTM, aside from one question

package.json Show resolved Hide resolved
@vkarpov15 vkarpov15 merged commit 881c5ab into 7.1 Apr 25, 2023
36 checks passed
@hasezoey hasezoey deleted the vkarpov15/gh-13010 branch April 25, 2023 18:19
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.

None yet

2 participants