1.6 Operation - Gs1TestTeam/MongoDB_Task GitHub Wiki

1.6 Operation

Stopping MongoDB server.

To stop mongod from mongo shell use these commands

use admin

db.shutdownServer()

Restarting MongoDB server.

Go to Services list of your PC. Click on MongoDB Server service and then click "Start". RestartMongo picture

Additional info at This Link

Repairing an improperly shut down DB

When a Mongo database is stopped incorrectly it may lead to data corruption and prevent MongoDB from restarting. To fix it do a back up and use the command

mongod --repair

This command will rebuild indexes, erase all corrupted data and create empty files for missing data. For more info see Link