Cannot connect to the MongoDB at localhost:27017.
Error:
Network is unreachable. Reason: couldn't connect to server localhost:27017, connection attempt failed: SocketException: Error connecting to localhost:27017 (127.0.0.1:27017) :: caused by :: No connection could be made because the target machine actively refused it.
We get this error, if mongodb is unreachable means not running in our machine.
To start a MongoDB service that is in stop mode, please follow those steps.
- Press window key + R to open Run window.
- Then type "services.msc" to open services window.
- Then select MongoDB server, right click on it, finally click on the start menu entry.
Tags:
MongoDB