-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix(NODE-4423): better type support for nested objects in query & update #3328
Conversation
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.
Thanks for the submission! The tests look solid, I'm adding a few clean up items and will revisit once this passes our CI.
Co-authored-by: Daria Pardue <[email protected]>
Co-authored-by: Daria Pardue <[email protected]>
Co-authored-by: Daria Pardue <[email protected]>
Co-authored-by: Daria Pardue <[email protected]>
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.
lint fix
PS: Would it be possible after this and the previous PR #3259 to get a mention in the release notes for 4.8 and / or be added to https://github.com/mongodb/node-mongodb-native/blob/main/CONTRIBUTORS.md ? All the best! |
@coyotte508 Apologies for the oversight on the release notes - we always want to give credit to the community for the contributions, so I'll get that fixed right away. The contributors file is currently not maintained, but we have plans to start generating it from github data. |
@jaydenseric We're looking to put out a patch tomorrow! |
@coyotte508 this kind of updates fail type check:
Any idea how to fix? |
@jer-sen for me there are no TS errors, but it's more lax (allows invalid types). |
@coyotte508 I also have an issue with variables in keys:
It seems that TS give to Any idea how to fix this without a forced cast? |
I think it's because I use readonly arrays:
Could you improve your PR to handle this case? |
I think https://github.com/mongodb/node-mongodb-native/blob/main/src/mongo_types.ts#L532 is the problem, you could change You can do the PR if this changes fixes your issue :), or open an issue for someone of the mongodb team on JIRA. I'm going on holiday myself! |
Thanks @coyotte508 but I am a bit lost... |
@coyotte508 @dariakp I have created:
|
Description
What is changing?
Better typing for update & query
Is there new documentation needed for these changes?
What is the motivation for this change?
The second error is a regression. This PR fixes both issues
Tickets:
Double check the following
npm run check:lint
script<type>(NODE-xxxx)<!>: <description>