How to fix MongoDb connection issue with nestjs
Microsoft Net Framework

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://0.0.0.0:27017";

Share This with your friend by choosing any social account


Upcoming Articles
You may also read following recent Post
Copyright Future Minutes © 2015- 2024 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM