Why I can't connect to MongoDB? exception: connect failed

When I type mongo it gives me error:

MongoDB shell version: 2.4.14
connecting to: test
Fri Dec  9 11:20:22.550 Error: couldn't connect to server at src/mongo/shell/mongo.js:145
exception: connect failed

When I start the project, it says that failed to connect to server [localhost: 27017]

I was working before but when another app was deployed to server (that also uses mongodb) it stopped working.

I installed mongodb again but no success. :(

Could anyone tell me what is the problem?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Are you seeing any indication of an error or issue in your log files? This would be the first place to start when checking if the service has failed for some reason. If you can share any errors or warnings showing up there we can better assist in troubleshooting.