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

feat(NODE-4267): support nested fields in type completion for UpdateFilter #3259

Merged
merged 6 commits into from Jun 17, 2022

Conversation

coyotte508
Copy link
Contributor

@coyotte508 coyotte508 commented May 23, 2022

Description

What is changing?

The MatchKeysAndValues type used by UpdateFilter is changed, inspired by the Filter type for querying.

Is there new documentation needed for these changes?

No

What is the motivation for this change?

The Filter type for querying is very nice. But the UpdateFilter type doesn't support type completion for nested fields.

https://jira.mongodb.org/projects/NODE/issues/NODE-4267

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: <type>(NODE-xxxx)<!>: <description>
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@coyotte508 coyotte508 marked this pull request as draft May 23, 2022 08:29
@coyotte508

This comment was marked as outdated.

The type-checking is not as strict as it could be
src/mongo_types.ts Outdated Show resolved Hide resolved
@coyotte508 coyotte508 marked this pull request as ready for review May 23, 2022 09:38
src/mongo_types.ts Outdated Show resolved Hide resolved
Co-authored-by: Julien Chaumond <julien@huggingface.co>
@bajanam bajanam added the External Submission PR submitted from outside the team label May 24, 2022
@baileympearson
Copy link
Contributor

Hey @julien-c! Thanks for this contribution. The Node team is interested in adding this feature to the driver but we don't have the bandwidth at the moment to evaluate the changes and get it merged.

We plan on scheduling this work - you can track the status in the Jira ticket you filed (https://jira.mongodb.org/browse/NODE-4267).

@baileympearson baileympearson added Team Review Needs review from team and removed External Submission PR submitted from outside the team labels Jun 15, 2022
@baileympearson
Copy link
Contributor

@julien-c Looks like this branch is behind main, and has some failing tests in CI that should pass with updates. Do you want to update the branch with changes in main? I also don't mind doing it, if you don't mind me pushing to your branch.

@coyotte508
Copy link
Contributor Author

coyotte508 commented Jun 16, 2022

@baileympearson I updated the branch - feel free to update it too if needed :)

@baileympearson
Copy link
Contributor

Thanks - and sorry for pinging the wrong user about this PR!

@baileympearson
Copy link
Contributor

@coyotte508 Thanks for taking the time to help us with this and thank you for being patient with us!

@baileympearson baileympearson merged commit 1a9a44c into mongodb:main Jun 17, 2022
@coyotte508 coyotte508 deleted the update-filter-type branch June 17, 2022 21:23
@coyotte508
Copy link
Contributor Author

coyotte508 commented Jul 19, 2022

There's a regression when wanting to update nested objects directly:

interface User {
  subscription: {
    paymentMethod: {
      last4: string;
      expiration: Date;
    }
  }
}

I can update subscription.paymentMethod.last4 or subscription.paymentMethod.expiration invidiually but not subscription.paymentMethod.

Edit: posted in the Jira issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Review Needs review from team
Projects
None yet
4 participants