node-mongodb-native - PR #3349: Fix type for nested objects in query & update

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Minor - P4
    • 4.9.0
    • Affects Version/s: None
    • Component/s: TypeScript
    • 0
    • None
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      jer-sen has created PR #3349: Fix type for nested objects in query & update in node-mongodb-native


      PR description

      Fix type for nested objects in query & update added in https://github.com/mongodb/node-mongodb-native/pull/3328

      What is changing?

      • 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)

      What is the motivation for this change?

      const _: MatchKeysAndValues<{ aaa: readonly { bbb: 'ccc' }[] }> = { 'aaa.$.bbb': 'ccc' }; // Error
      const _: MatchKeysAndValues<{ aaa: { bbb: { ccc: 'ddd'[] }[] }> = { 'aaa.$.bbb.$[arrayFilter]': 'ddd' }; // Error
      

              Assignee:
              Unassigned
              Reporter:
              TPM Jira Automations Bot
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: