fcc-mongo-mongoose-challenges@0.0.1 start > node server.js Your app is listening on port 3000 /home/runner/boilerplate-mongomongoose/node_modules/mongoose/lib/connection.js:694 throw new MongooseError('The uri parameter to openUri() must be a ’ + ^ MongooseError: The uri parameter to openUri() must be a string, got “undefined”. Make sure the first parameter to mongoose.connect() or mongoose.createConnection() is a string.
fix earlier problem, now I have another error, I passed * “mongoose version ^5.11.15” dependency should be in package.json
error
Failed:“mongoose” should be connected to a database > fcc-mongo-mongoose-challenges@0.0.1 start
node server.js
Your app is listening on port 3000
/home/runner/boilerplate-mongomongoose/node_modules/mongodb/lib/cmap/connection.js:299
callback(new MongoError(document));
^
MongoError: bad auth : authentication failed
at MessageStream.messageHandler (/home/runner/boilerplate-mongomongoose/node_modules/mongodb/
MONGO_URI=“mongodb+srv://username:password@host/database?retryWrites=true&w=majority”
Is that the correct format? if yes , then that is what I did. there is an issue somewhere will figure it out eventually, Thank you.
I am the only user and I used my username and password, still I created and user and tried, same issue, after you hit connection you choose drivers or something else?
In the left side under SECURITY > Database Access > Click the Edit button on the right side and change the credentials. Autogenerate the password and write it down or create a new one (use lowercase/uppercase letters just to avoid issue). It shows the user name at the top as well.
Just to be sure, you are not literally using username:password right?
The connection string works if you get a bad auth, it just isn’t authenticating correctly. I would suggest you create a new password in the MongoDB Atlas dashboard as I said.