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

TypeError: Cannot read property 'bson' of undefined

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.2.7
    • Component/s: None
    • Labels:
    • Environment:
      not use mongoose
      use typesript and ts-node

      Recently  when I restart my node app, I always get below error:

      TypeError: Cannot read property 'bson' of undefined
      at prepareLegacyFindQuery (/.../node_modules/mongodb-core/lib/wireprotocol/query.js:148:25)
      at Object.query (/.../node_modules/mongodb-core/lib/wireprotocol/query.js:23:19)
      at cursor.topology.selectServer (/.../node_modules/mongodb-core/lib/cursor.js:738:20)
      at ReplSet.selectServer (/.../node_modules/mongodb-core/lib/topologies/replset.js:1109:3)
      at ReplSet.selectServer (/.../node_modules/mongodb/lib/topologies/topology_base.js:362:32)
      at initializeCursor (/.../node_modules/mongodb-core/lib/cursor.js:618:26)
      at nextFunction (/.../node_modules/mongodb-core/lib/cursor.js:456:12)
      at Cursor.next (/.../node_modules/mongodb-core/lib/cursor.js:766:3)
      at Cursor._next (/.../node_modules/mongodb/lib/cursor.js:216:36)
      at nextObject (/.../node_modules/mongodb/lib/operations/cursor_ops.js:192:10)

       

      But if I restart my app repeatly at about 3 times, the error gone, so curious what caused this error, please help!

            Assignee:
            daniel.aprahamian@mongodb.com Daniel Aprahamian (Inactive)
            Reporter:
            1326099664@qq.com xh mm
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: