adrianhajdin / project_mern_memories

This is a code repository for the corresponding video tutorial. Using React, Node.js, Express & MongoDB you'll learn how to build a Full Stack MERN Application - from start to finish. The App is called "Memories" and it is a simple social media app that allows users to post interesting events that happened in their lives.
https://youtube.com/playlist?list=PL6QREj8te1P7VSwhrMf3D3Xt4V6_SRkhu
4.95k stars 1.83k forks source link

mongoDB cluster can not connect error #187

Open JyothsnaVellampalli opened 4 months ago

JyothsnaVellampalli commented 4 months ago

While running server, I got this error, Error: querySrv ENOTFOUND _mongodb._tcp.practice.jto9p.mongodb.net did not connect

Kindly add correct mongo url.

PY-SENSEI commented 3 weeks ago

@JyothsnaVellampalli hi, there can be many reasons for that one I might think is :

  1. your connection string : make sure your connection string looks something like this mongodb+srv://your_username>:<your_password>@practice.jto9p.mongodb.net/<database?retryWrites=true&w=majority and replace your username and password from MongoDB to here. if nothing works pinpoint your error using this: const client = new MongoClient(uri, { useNewUrlParser: true, useUnifiedTopology: true, loggerLevel: 'debug' }); then log the error on chatgpt for further help. hope it helps :) Happy coding.