This version of the documentation is archived and no longer supported.


On this page


db.repairDatabase() provides a wrapper around the database command repairDatabase, and has the same effect as the run-time option mongod --repair option, limited to only the current database. See repairDatabase for full documentation.



If you are running with journaling enabled, there is almost never any need to run repairDatabase unless you need to recover from a disk-level data corruption. In the event of an unclean shutdown, the server will be able to restore the data files to a clean state automatically.

Changed in version 2.6: The db.repairDatabase() is now available for secondary as well as primary members of replica sets.