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

v4 query type checking adversely impacts environments with advanced document types

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • Not Needed
    • Not Needed

      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.

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            email@ermolay.com Ermolay Romanov
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: