Server record does not share hostname with parent URI

Viewed 62

I am using Express js with Mongodb for the database. Sometimes but not all times, when I change something on the code and save, I get this error.

MongoParseError: Server record does not share hostname with parent URI 
at QueryReqWrap.callback (C:\Users\User\Documents\node\01-connecting-to-the-mongodb-server\node_modules\mongodb\lib\core\uri_parser.js:77:11)
at QueryReqWrap.onresolve [as oncomplete] (dns.js:205:10)

I can't seem to find the answer in google. Can anyone point me in the right direction? My connection looks like so

mongoose
  .connect(
    "mongodb+srv://kurash:******@cluster0.twgxh.mongodb.net/shop?retryWrites=true&w=majority",
    { useNewUrlParser: true }
  )
  .then((result) => {
    app.listen(3000);
  })
  .catch((err) => {
    console.log(err);
  });
0 Answers
Related