MongoDB: db.fsyncLock() method
db.fsyncLock
The db.fsyncLock() method is used to force the mongod to flush all pending write operations to the disk and locks the entire mongod instance to prevent additional writes until the user releases the lock with the db.fsyncUnlock() command. db.fsyncLock() is an administrative command.
Syntax:
db.fsyncLock()
This function locks the database and create a window for backup operations.
Example: MongoDB: db.fsyncLock() method
db.fsyncLock();
Sample document in the restaurants collection:
Output:
> db.fsyncLock(); { "info" : "now locked against writes, use db.fsyncUnlock() to unlock", "seeAlso" : "http://dochub.mongodb.org/core/fsynccommand", "ok" : 1 }
Retrieve the restaurants data from here
Previous:
db.dropDatabase() method
Next:
db.fsyncUnlock() method
- Weekly Trends
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join
- JavaScript functions Exercises
- Python Tutorial
- Python Array Exercises
- SQL Cross Join
- C# Sharp Array Exercises
We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook