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

Investigate NODE-4423 - Type Regressions in 4.8

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Done
    • None
    • None
    • None
    • 1
    • Not Needed

    Description

      NODE-4423 Description

      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.

      Attachments

        Issue Links

          Activity

            People

              neal.beeken@mongodb.com Neal Beeken
              dbeng-pm-bot PM Bot
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: