MongoParseError: Invalid connection string
Instead of User://localhost
, use mongodb://localhost/
I had the same problem.
I was receiving the same error, then I used:
mongoose.connect("mongodb://localhost:27017/[yourDbName]", { useUnifiedTopology: true, useNewUrlParser: true});
Substitute [yourDbName]
for your MongoDB database's name:
The host you have written is not correct, and it should be
mongoose.connect('mongodb://localhost:27017/User',{ useNewUrlParser: true })