Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

115
Views
Mongoose connection issue with .env used into access

I am unable to pass requests with postman, and the error message is the one being printed on console. Before applying then method I was able to see the connection successful mssage but still wasn't able to get/post via postman

//database connection
mongoose.connect(
  process.env.MONGO_URL,
  { useNewUrlParser: true, useUnifiedTopology: true }).then(()=>{
    console.log("connection successful")
  }).catch((error)=>{
    console.log("Error occured on connection")
  });

Requiring the connection via

const mongoose = require("mongoose");

and the MONGO_URL mentioned in .env file is

MONGO_URL = mongodb+srv://username:password@cluster0.8noo9.mongodb.net/dbname?retryWrites=true&w=majority

been stuck here for a while. I am setting up mongoose for the first time

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It was due to not whitelisting m IP. If anyone has the same issue try it first. Go to mongodb and whitelist your IP in security -> network connections

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!