MongoParseError:

MongoParseError: URI malformed, cannot be parsed
at parseConnectionString (/home/mobcoder/Downloads/mflix-js/node_modules/mongodb/lib/core/uri_parser.js:542:21)
at connect (/home/mobcoder/Downloads/mflix-js/node_modules/mongodb/lib/operations/connect.js:272:3)
at cb (/home/mobcoder/Downloads/mflix-js/node_modules/mongodb/lib/mongo_client.js:215:5)
at maybePromise (/home/mobcoder/Downloads/mflix-js/node_modules/mongodb/lib/utils.js:719:3)
at MongoClient.connect (/home/mobcoder/Downloads/mflix-js/node_modules/mongodb/lib/mongo_client.js:211:10)
at Function.connect (/home/mobcoder/Downloads/mflix-js/node_modules/mongodb/lib/mongo_client.js:421:22)
at Object. (/home/mobcoder/Downloads/mflix-js/src/index.js:23:13)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Module._compile (/home/mobcoder/Downloads/mflix-js/node_modules/pirates/lib/index.js:99:24)
at Module._extensions…js (internal/modules/cjs/loader.js:789:10)
[nodemon] app crashed - waiting for file changes before starting…

“MongoParseError: URI malformed, cannot be parsed”

Please check if you are able to connect with shell to DB first
Then check your config file for any issues with URI

1 Like