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



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://w3resource.com/mongodb/shell-methods/database/db-fsyncUnlock.php