Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-4423

Type Regressions in 4.8

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.8.1
    • Affects Version/s: 4.8.0
    • Component/s: TypeScript
    • 1
    • Not Needed

      What problem are you facing?

      It's great with Type support for updates, but it comes with at least two regressions breaking a lot of our codebase. I'm omitting _id when creating the collection type (see screenshots) - as I believe was the recommendation before.

      1. _id is not allowed in neither $set or $setOnInsert. It is still allowed for queries, so I'm pretty sure it's not an error in our types.
      2. Setting sub-documents doesn't seem to be work either.

      This gives a lot of errors - especially since type errors on the queries/updates somehow breaks the entire type resolve chain (any subsequent code won't even recognise it's dealing with a promise anymore).

      What driver and relevant dependency versions are you using?

      Node.js Mongo Driver 4.8 and TypeScript 4.7.4

      Steps to reproduce?

      Set up the types as per the screenshots.

        1. array.png
          80 kB
          Robert Herber
        2. array error.png
          305 kB
          Robert Herber
        3. embedded document.png
          64 kB
          Robert Herber
        4. embedded document error.png
          333 kB
          Robert Herber
        5. Screenshot 2022-07-15 at 09.05.07.png
          64 kB
          Robert Herber
        6. Screenshot 2022-07-15 at 09.06.57.png
          38 kB
          Robert Herber
        7. Screenshot 2022-07-15 at 09.07.35.png
          17 kB
          Robert Herber

            Assignee:
            daria.pardue@mongodb.com Daria Pardue
            Reporter:
            robert@herber.me Robert Herber
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: