Add support for mongodb driver v4
See original GitHub issueIssue Description
Exactly in this commit mongodb stopped exporting a Cursor object.
Because of that, every reference to ParentCursor.Prototype
in MongoEntityManager
(like here) is failing with error “Cannot read property ‘prototype’ of undefined”.
Expected Behavior
No error expected.
Actual Behavior
Error “Cannot read property ‘prototype’ of undefined”
TypeError: Cannot read property 'prototype' of undefined
at FindCursor.cursor.toArray (/entity-manager/MongoEntityManager.ts:679:37)
at MongoEntityManager.<anonymous> (/entity-manager/MongoEntityManager.ts:97:23)
at step (/node_modules/tslib/tslib.js:143:27)
at Object.next (/node_modules/tslib/tslib.js:124:57)
at fulfilled (/node_modules/tslib/tslib.js:114:62)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
Steps to Reproduce
- Add typeorm dependency
- Add mongodb v4 dependency.
My Environment
Dependency | Version |
---|---|
Operating System | Ubuntu 18.04 on wsl2 |
Node.js version | v14.17.0 |
Typescript version | v4.0.8 |
TypeORM version | v0.2.34 |
Additional Context
Relevant Database Driver(s)
-
aurora-data-api
-
aurora-data-api-pg
-
better-sqlite3
-
cockroachdb
-
cordova
-
expo
-
mongodb
-
mysql
-
nativescript
-
oracle
-
postgres
-
react-native
-
sap
-
sqlite
-
sqlite-abstract
-
sqljs
-
sqlserver
Are you willing to resolve this issue by submitting a Pull Request?
- Yes, I have the time, and I know how to start.
- Yes, I have the time, but I don’t know how to start. I would need guidance.
- No, I don’t have the time, although I believe I could do it if I had the time…
- No, I don’t have the time and I wouldn’t even know how to start.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:19
- Comments:15 (3 by maintainers)
Top Results From Across the Web
Driver Compatibility - MongoDB
Please check our driver documentation page home for the latest information on driver compatibility with MongoDB and driver languages.
Read more >Start Developing with MongoDB — MongoDB Drivers
Connect your application to your database with one of our official libraries. The following libraries are officially supported by MongoDB.
Read more >MongoDB Node.js Driver v4.7.0 Released
The MongoDB Node.js team is pleased to announce version 4.7.0 of the mongodb package! Happy MongoDB World Day! Release Highlights Support ...
Read more >MongoDB Node.js Driver v4.2.0 Released
This release includes a number of features we're happy to announce. You can now run aggregate pipelines that write to MongoDB using $out...
Read more >MongoDB Node.js Driver 4.10.0 Released
0 release (both callbacks and promises are supported). Any new features added to MongoDB will be automatically inherited but will only support ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
🚨🚨🚨 Customers using certain tiers of MongoDB Atlas are being force-upgraded to MongoDB 5 this month as Mongo is dropping support for older databases. The minimum driver version supported is 4.0. https://docs.mongodb.com/drivers/node/current/compatibility/ 🚨🚨🚨
Currently, TypeORM is only compatible with mongo node v3.