I\'m using NodeJS wih MongoDB using mongodb package. When I run mongod command it works fine and gives "waiting for connection on port 27017". So, mongod seems to
I was facing the same issue on windows 10. I just uninstall MongoDB and installed it again and it started working. It solved my problem.
If you already installed "MongoDB", if you accidentally exit from the MongoDB server, then "restart your system".
This method solved me...
[On Windows only]
And also another method is there:
press:
Windows + R
type:
services.msc
and click "ok", it opens "services" window, and then search for "MongoDB Server" in the list. After you find "MongoDB Server", right-click and choose "start" from the pop-up menu.
The MongoDb Server will start running.
Hope it works!!
For windows - just go to Mongodb folder (ex : C:\ProgramFiles\MongoDB\Server\3.4\bin) and open cmd in the folder and type "mongod.exe --dbpath c:\data\db"
if c:\data\db folder doesn't exist then create it by yourself and run above command again.
All should work fine by now.))
Press CTRL+ALT+DELETE/task manager , then go to services , find MongoDB , right click on it. start. go back to terminal . npm start it will work.
I had the same issue on Windows.
Ctrl+C to close mongod, and start mongod again.
Am not sure, but it seems that initially mongod was working opening and closing connections. Then, it was not able to close some earlier connections and reached limit for opened ones. After restarting mongod, it works again.
The solution was to install MongoDB from below location: https://www.mongodb.com/download-center/community