question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for mongodb driver v4

See original GitHub issue

Issue 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

  1. Add typeorm dependency
  2. 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:open
  • Created 2 years ago
  • Reactions:19
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

18reactions
mschneecommented, Jan 13, 2022

🚨🚨🚨 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/ 🚨🚨🚨

15reactions
imnotjamescommented, Jul 15, 2021

Currently, TypeORM is only compatible with mongo node v3.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found