Skip to content

Conversation

@FaizBShah
Copy link
Contributor

@FaizBShah FaizBShah commented Feb 26, 2024

Fixes #14378

Summary
Fixes the missing typescript details from the options parameter of functions like updateMany(), updateOne(), etc. The issue happened because the Omit in Omit<MongooseQueryOptions<TRawDocType>, 'lean'> was making the type of the keys vague because MongooseQueryOptions contains [other: string]: any. To fix this, introdduced a new TS Util function called ExcludeKeys which fixes this logic without weakening the type

Examples
The property timestamps and other such params are now visible
Screenshot 2024-02-26 190616

Its still supporting arbitrary options like fallback without any type issues
Screenshot 2024-02-26 190710

@sderrow
Copy link
Contributor

sderrow commented Feb 26, 2024

Can't formally review, but LGTM!

@vkarpov15 vkarpov15 merged commit 28855e1 into Automattic:master Feb 26, 2024
@vkarpov15 vkarpov15 added this to the 8.2.1 milestone Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants