Sometimes the Mongo database starts showing error when your system accidentally gets shut down. Here I will explain way to repair MongoDB database using Command Prompt in Windows.
Go to C directory and create a folder on root named data.
Press Windows + R to open Run and type cmd and click OK button.
Change directory to root using command
Type the Full Path of mongod.exe service. Check your installation directory of MongoDB. In my case, the installed directory is Program Files (x86)
"Program Files (x86)\MongoDB\Server\3.0\bin\mongod.exe" --dbpath C:\data --repair
Notice the parameter –repair is added in the command.
Hit Enter key and wait for it to finish.
Your Mongo database is now repaired
Thanks for reading.