I have (note: username and password are made up):
const CONNECTION_URL = "mongodb+srv://smith_bob:smith_bob@hotmail.com:T@llyHo!:@cluster0.r92qc.mongodb.net/myFirstDatabase?retryWrites=true&w=majority";
const PORT = process.env.PORT || 5000;
mongoose.connect(CONNECTION_URL,{useNewUrlParser: true, useUnifiedTopology: true})
.then(()=>app.listen(PORT,()=> console.log(`Server running on port: ${PORT}`)))
.catch((error)=> console.log(error.message));
but get the following when I run nodemon index.js:
mondodb+srv URI cannot have port number \
[nodemon] clean exit - waiting for changes before restart
Any ideas what's going on?
I tried using Percent Encoded characters but got errors as follows:
. . . smith_bob:smith_bob@hotmail.com:%40@llyHo!: . . .
mongodb+srv URI cannot have port number
. . . smith_bob%3Asmith_bob%40hotmail.com%3AT%40llyHo!%3A . . .
bad auth : authentication failed
. . . smith_bob:smith_bob%40hotmail.com%3AT%40llyHo!: . . .
Password contains unescaped characters
. . . smith_bob:smith_bob@hotmail.com%3AT%40llyHo!: . . .
mongodb+srv URI cannot have port number