db.fsyncUnlock() in mongodb

db.fsyncUnlock()

This method unlocks a mongod instance to allow writes and reverses the operation of a db.fsyncLock() operation. Typically you will use db.fsyncUnlock() following a database backup operation.


Note: db.fsyncUnlock() is an administrative operation.


Approach 1: When the database is locked

MongoDB 

db.fsyncUnlock()

Output:


{ "info" : "fsyncUnlock completed", "lockCount" : NumberLong(0), "ok" : 1 }


Approach 2: When fsyncUnlock() is called prior is fsyncLock()

MongoDB

db.fsyncUnlock()

Output:


{ "ok" : 0, "errmsg" : "fsyncUnlock called when not locked" }


No comments:

Post a Comment