Tell us what’s happening:
Describe your issue in detail here.
I am currently working with freecodecamp exercises with node.js.
I am trying setup connection to my MongoDB database using mongoos.
Your code so far
Code in myApp.js:
const mongoose = require(‘mongoose’)
mongoose.connect(process.env.MONGO_URI, {useNewUrlParser: true, useUnifiedTopology: true });
Code in sample.env:
MONGO_URI = ‘‘mongodb+srv://abhinavwatve:@cluster0.1lq4z.mongodb.net/myFirstDatabase?retryWrites=true&w=majority’’
Code in package.json:
{
“name”: “fcc-mongo-mongoose-challenges”,
“version”: “0.0.1”,
“description”: “A boilerplate project”,
“main”: “server.js”,
“scripts”: {
“start”: “node server.js”
},
“dependencies”: {
“body-parser”: “^1.15.2”,
“dotenv”: “^8.2.0”,
“express”: “^4.12.4”,
“mongodb”: “~3.6.0”,
“mongoose”: “~5.4.0”
},
“repository”: {
“type”: “git”,
“url”: “GitHub - freeCodeCamp/boilerplate-mongomongoose: A boilerplate for the freeCodeCamp curriculum.”
},
“keywords”: [
“node”,
“mongoose”,
“express”
],
“license”: “MIT”
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.60 Safari/537.36
Challenge: Install and Set Up Mongoose
Link to the challenge: