Tell us what’s happening:
Hello I get the error message here:
“mongoose” should be connected to a database
I believe the problem is in my link:
mongodb+srv://Annie:@cluster0-6z8hh.mongodb.net/?retryWrites=true&w=majority
The message from mongoDB is: Replace with the password for the Annie user. Replace with the name of the database that connections will use by default.
I cannot find the dbname that they ask me to insert. What can I do?
Your code so far
“dependencies”: {
“express”: “^4.17.1”,
“body-parser”: “^1.19.0”,
“mongoose”: “^5.9.1”,
“mongodb”: “^3.5.2”
},
and this in app.js:
const mongoose = require(‘mongoose’);
mongoose.connect(process.env.MONGO_URI,{ useNewUrlParser: true, useUnifiedTopology: true });
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36
.
Challenge: Install and Set Up Mongoose
Link to the challenge: