How to fix MongoDb connection issue with nestjs

  By Tahir   Posted on August-03-2023   106


Error: failed to connect to server [localhost:27017] on first connect [Error: connect ECONNREFUSED ::1:27017

when you install MongoDB on a local pc and you will see the server path like this :mongodb://localhost:27017

but whatever you try your angular/nestjs application to connect using this link then you get error

const url = "mongodb://localhost:27017";

Use this: Remoe localhost from url

const url = "mongodb://";

By      03-Aug-2023 Views  106

You may also read following recent Post

Item Image
 649 shaheer
Item Image
 662 shaheer
Item Image
Item Image
Item Image
Submit Post - Article - Ask a Question - Ask an Interview Question - Submit Useful Links