June 2014
Intermediate to advanced
696 pages
38h 52m
English
There are a couple reasons to run a repair on the MongoDB database—for example, if the system crashes, or if a data integrity problem is manifested in the application, or even just to reclaim some unused disk space.
You can initiate a repair of a MongoDB database from the MongoDB shell or from the mongod command line. To execute a repair from the command line, use --repair and --repairpath <repair_path>. <repair_path> specifies the location to store temporary repair files. For example:
mongod --repair --repairpath /tmp/mongdb/data
To execute a repair from the MongoDB client, use the db.repairDatabase(options) command, as in this example:
db.repairDatabase({ ...
Read now
Unlock full access