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

Investigate NODE-4594 - v4 query type checking adversely impacts environments with advanced document types

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Unknown
    • Resolution: Done
    • None
    • None
    • None
    • 2
    • Not Needed

    Description

      NODE-4594 Description

      What problem are you facing?

      TypeScript processing (type checking and transpilation) is severely slowed down when types with high count of unique key names, enum values, type unions, and recursion are passed to MongoDB collection methods.

      TypeScript processing ultimately fails with the following errors most prevalent:

      error TS2589: Type instantiation is excessively deep and possibly infinite.
      error TS2615: Type of property 'prop49' circularly references itself in mapped type 

       

      What driver and relevant dependency versions are you using?

       

      bson: ~4.7.0
      mongodb: ~4.9.0
      typescript: ~4.8.2

       

      Steps to reproduce?

      Please consult minimal reproduction repository:
      https://github.com/thinkalpha/node-mongodb-typechecking-performance

      Install dependencies ( npm i ) and run npm exec tsc --incremental false to reproduce the issue. Consult class.ts for Driver call sites and the individual model types for additional detail. The "circular" reference example is minimal, while the "slow" example is an anonymized real-world data model. Both employ recursive types.

       

      Attachments

        Issue Links

          Activity

            People

              daria.pardue@mongodb.com Daria Pardue
              dbeng-pm-bot PM Bot
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: