Tell us what’s happening: keep getting error that “mongoose” should be connected to a database
code so far:
.env
MONGO_URI=“mongodb+srv://codymccurry:@cluster0-lmq3n.mongodb.net/?retryWrites=true&w=majority”
package.json
“dependencies”: {
“express”: “^4.12.4”,
“body-parser”: “^1.15.2”,
“mongoose”: “^3.6.0”,
“mongodb”: “^3.0.10”
}
myApp
const mongoose=require(“mongoose”);
mongoose.connect(process.env.MONGO_URI);
Challenge: Install and Set Up Mongoose
Link to the challenge: