{"action":"opened","issue":{"url":"https://api.github.com/repos/Kononnable/typeorm-model-generator/issues/74","repository_url":"https://api.github.com/repos/Kononnable/typeorm-model-generator","labels_url":"https://api.github.com/repos/Kononnable/typeorm-model-generator/issues/74/labels{/name}","comments_url":"https://api.github.com/repos/Kononnable/typeorm-model-generator/issues/74/comments","events_url":"https://api.github.com/repos/Kononnable/typeorm-model-generator/issues/74/events","html_url":"https://github.com/Kononnable/typeorm-model-generator/issues/74","id":326366533,"number":74,"title":"Try connection MongoDB: database name must be a string","user":{"login":"clystian","id":1278819,"avatar_url":"https://avatars1.githubusercontent.com/u/1278819?v=4","gravatar_id":"","url":"https://api.github.com/users/clystian","html_url":"https://github.com/clystian","followers_url":"https://api.github.com/users/clystian/followers","following_url":"https://api.github.com/users/clystian/following{/other_user}","gists_url":"https://api.github.com/users/clystian/gists{/gist_id}","starred_url":"https://api.github.com/users/clystian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clystian/subscriptions","organizations_url":"https://api.github.com/users/clystian/orgs","repos_url":"https://api.github.com/users/clystian/repos","events_url":"https://api.github.com/users/clystian/events{/privacy}","received_events_url":"https://api.github.com/users/clystian/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-25T03:14:56Z","updated_at":"2018-05-25T03:14:56Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\nTrying run a generated project for mongodb, connection fails with message `MongoDB: database name must be a string`\r\n\r\na solution propose by @pleerock is about upgrading dependency: mongodb version: ^3.0.0\r\n@alexbatis reports: *\"when generating a project with the --express flag the default  version (as specified in package.json) was \"^2.2.31\"*\r\n\r\n### Please update dependencies in generation tool\r\n\r\n**[source]** https://github.com/typeorm/typeorm/issues/2180\r\n\r\nIssue type:\r\n[ * ] question\r\n[ * ] bug report\r\n\r\nDatabase system/driver:\r\n[ * ] mongodb\r\n\r\nTypeORM version:\r\n[ * ] latest\r\n\r\nSteps to reproduce or a small repository showing the problem:\r\n\r\nCreate a default project with command\r\n```typeorm init --name test --database mongdb --express\r\ncd test\r\nyarn install\r\nyarn start\r\n```\r\nYou can see the following error :\r\n```\r\n{ MongoError: database name must be a string\r\n     at Function.MongoError.create (/app/node_modules/mongodb-core/lib/error.js:31:11)\r\n     at validateDatabaseName (/app/node_modules/mongodb/lib/db.js:1680:57)\r\n     at new Db (/app/node_modules/mongodb/lib/db.js:156:3)\r\n     at Db.db (/app/node_modules/mongodb/lib/db.js:1208:12)\r\n     at MongoQueryRunner.getCollection (/app/src/driver/mongodb/MongoQueryRunner.ts:803:40)\r\n     at MongoQueryRunner.<anonymous> (/app/src/driver/mongodb/MongoQueryRunner.ts:272:27)\r\n     at step (/app/node_modules/typeorm/driver/mongodb/MongoQueryRunner.js:32:23)\r\n     at Object.next (/app/node_modules/typeorm/driver/mongodb/MongoQueryRunner.js:13:53)\r\n     at /app/node_modules/typeorm/driver/mongodb/MongoQueryRunner.js:7:71\r\n     at new Promise (<anonymous>)\r\n       name: 'MongoError',\r\n       message: 'database name must be a string',\r\n       driver: true }\r\n```\r\n\r\nMy ormconfig.json file :\r\n```\r\n{\r\n   \"type\": \"mongodb\",\r\n   \"database\": \"test\",\r\n   \"synchronize\": true,\r\n   \"logging\": false,\r\n   \"entities\": [\r\n      \"src/entity/**/*.ts\"\r\n   ],\r\n   \"migrations\": [\r\n      \"src/migration/**/*.ts\"\r\n   ],\r\n   \"subscribers\": [\r\n      \"src/subscriber/**/*.ts\"\r\n   ],\r\n   \"cli\": {\r\n      \"entitiesDir\": \"src/entity\",\r\n      \"migrationsDir\": \"src/migration\",\r\n      \"subscribersDir\": \"src/subscriber\"\r\n   }\r\n}\r\n```"}}
{"actor":{"display_login":"clystian"}}