dpu_defcon
dpu_defcon

Reputation: 31

Loopback4 MongoParseError: URI malformed

There is no exception when I am trying without the Username and Password but I got error while giving value for user and password.

The exception I got

{
"name": "Mongo",
"connector": "mongodb",
"url": "",
"host": "127.0.0.1",
"port": 27017,
"user": "username",
"password": "password",
"database": "otc",
"useNewUrlParser": true
}

Upvotes: 1

Views: 149

Answers (2)

dpu_defcon
dpu_defcon

Reputation: 31

Actually the issue was the password I used, I used special characters (eg. '%') in my password so while parsing the URL the URL parser Package used in loopback-mongo-connector threw this exception.

Upvotes: 2

farojos
farojos

Reputation: 56

The URL option overrides all the other options, so If you send a string with no characters it will override anyway. So the alternatives are just using the URL or delete it and then try again.

Upvotes: 0

Related Questions