-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix(NODE-4513): type for nested objects in query & update #3349
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
- Support union types (... extends unknown ? ... : never) - Fail if path is wrong (never vs unknown) - Support array operators in the middle of a path (number replaced by number | `$${'' | `[${string}]`}` and NestedPathsOfType removed)
Hi @jer-sen, thanks so much for your help with our types! Would it be possible to add some tests to demonstrate the fix? |
@nbbeeken sorry I will not have time for that, the fix works on my project, I took time to share it and give some simple repo but that's it. It will take to an already contributor less time to finalise what you are asking. |
Just a heads up, there's a failure with a Demonstrated by: collectionT.find({ 'laps.foo': 123 });
// Type number is not assignable to type FilterOperators<never> I'm looking into it on my end but let me know if you have any thoughts @jer-sen |
@nbbeeken fixed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just added some tests, thanks again for the help!
@nbbeeken you're welcome! Type checks are very useful. It could be further improved (arrayFilters, projections, first aggregate stages...) |
)" This reverts commit ec1a68f.
Description
Fix type for nested objects in query & update added in #3328
What is changing?
$${'' |
[${string}]}
and NestedPathsOfType removed)Is there new documentation needed for these changes?
No
What is the motivation for this change?
Double check the following
npm run check:lint
script<type>(NODE-xxxx)<!>: <description>