Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MongoDb with TypeORM doesn't work #7798

Closed
knopkem opened this issue Aug 9, 2021 · 1 comment
Closed

MongoDb with TypeORM doesn't work #7798

knopkem opened this issue Aug 9, 2021 · 1 comment
Labels
needs triage This issue has not been looked into

Comments

@knopkem
Copy link
Contributor

knopkem commented Aug 9, 2021

Bug Report

Current behavior

Running the example mongo-typeorm (docker, local mongodb) throws exception when accessing data:


[Nest] 9771  - 08/09/2021, 8:15:09 AM   ERROR [ExceptionsHandler] Cannot read property 'prototype' of undefined
TypeError: Cannot read property 'prototype' of undefined
    at FindCursor.cursor.toArray (/home/anon/projects/mongo-typeorm-sample/src/entity-manager/MongoEntityManager.ts:707:37)
    at MongoEntityManager. (/home/anon/projects/mongo-typeorm-sample/src/entity-manager/MongoEntityManager.ts:97:23)
    at step (/home/anon/projects/mongo-typeorm-sample/node_modules/tslib/tslib.js:143:27)
    at Object.next (/home/anon/projects/mongo-typeorm-sample/node_modules/tslib/tslib.js:124:57)
    at fulfilled (/home/anon/projects/mongo-typeorm-sample/node_modules/tslib/tslib.js:114:62)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

Expected behavior

  • in case of of an empty mongodb opening the browser http://localhost/photo should return an empty array
  • in case of using the docker image, it should return an array of photo entities
  • no error should be shown in nest.js

Environment


"@nestjs/common": "8.0.5",
"@nestjs/core": "8.0.5",
"@nestjs/platform-express": "8.0.5",
"@nestjs/typeorm": "8.0.2",
"mongodb": "4.1.0",
"reflect-metadata": "0.1.13",
"rimraf": "3.0.2",
"rxjs": "7.3.0",
"typeorm": "0.2.36"
 
For Tooling issues:
- Node version: 14.17.4
- Platform:  Linux 

Others:
* tried using docker-compose
* tried with local mongodb installed (same error)
@knopkem knopkem added the needs triage This issue has not been looked into label Aug 9, 2021
@jmcdo29
Copy link
Member

jmcdo29 commented Aug 9, 2021

TypeORM doesn't support Mongo v4. This is a problem with TypeORM not Nest. Please report it to the appropriate repo.

@jmcdo29 jmcdo29 closed this as completed Aug 9, 2021
@nestjs nestjs locked as spam and limited conversation to collaborators Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs triage This issue has not been looked into
Projects
None yet
Development

No branches or pull requests

2 participants