# Mongo gone

<figure><img src="/files/Z4lyvUe8to3z5Sg3Q0Mq" alt="MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017"><figcaption><p>MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017</p></figcaption></figure>

This all started when I wanted to connect my docker (not surprising) container to database. On the same port. I don't exactly remember what I did, but it got connected, but now I am not able to connect to the database on my local machine, it keeps throwing me CONNREFUSED on 27017

When I do a `brew services list` I was getting status of error.&#x20;

<figure><img src="/files/57ZjFWdW6DK9nTJH2kKY" alt=""><figcaption><p>This error was showing up for mongodb-community@4.4 too</p></figcaption></figure>

BUT WAIT

When I opened Mongo Compass RIGHT NOW, it started working again. Agh! This life if indeed funny.&#x20;

*I might think it was magic (which is one of the possibilities)* \
*But it also could be all the countless times I have*<br>

* uninstalled mongodb-community&#x20;
* reinstalled
* run `mongosh`&#x20;
* run `brew services start/stop mongodb-community`

**It is funny, because it only worked for a while, now it stopped again.**&#x20;

{% embed url="<https://www.mongodb.com/basics/uninstall-mongodb>" %}

Date: 4 June 2023<br>

This document was created at least 5 days ago, I'm not sure. **Anyway what helped, is this document**

{% embed url="<https://www.mongodb.com/community/forums/t/help-brew-mongodb-community-5-0-error-macos/125648/3>" %}

Saw this man on various mongo help I encountered. <br>

> Not all heroes wear capes, some are behind a computer screen

Thank you Ramachandra Tummala. Whoever you are, you saved me.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://shrutisantosh.gitbook.io/head-scratching-sde/mongo-gone.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
