w3resource

MongoDB: db.fsyncUnlock() method

db.fsyncUnlock

The db.fsyncUnlock() method is used to allow writes and reverses the operation of a db.fsyncLock() operation.

Syntax:

db.fsyncUnlock()

Example: MongoDB: db.fsyncUnlock() method

Here is the mongod instance already locked.

> db.fsyncLock();
{
        "info" : "now locked against writes, use db.fsyncUnlock() to unlock",
        "seeAlso" : "http://dochub.mongodb.org/core/fsynccommand",
        "ok" : 1
}

Now the following command will unlocked the mongod instance.

db.fsyncUnlock();

Output:

> db.fsyncUnlock();
{ "ok" : 1, "info" : "unlock completed" }

Retrieve the restaurants data from here

Previous: db.fsyncLock() method
Next: db.getCollection() method



Share this Tutorial / Exercise on : Facebook and Twitter