What is the use of the mongo.lock file?

Mongodb always creates the mongodb.lock file when the server starts and drops it before mongodb is stopped.

Removing mongodb.lock does not affect any data it just means that mongodb was not stopped correctly. So, you are correct in removing this file and running with the -repair option should fix database.

Leave a Comment