-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
None
-
Affects Version/s: 3.2.7
-
Component/s: None
-
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!