Skip to content

1.6 Operation

Olga Arsenieva edited this page Nov 19, 2018 · 12 revisions

1.6 Operation

Stopping MongoDB server.

To stop mongod from mongo shell use these commands

use admin db.shutdownServer()

Restarting MongoDB server.

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

Clone this wiki locally