MongoDB::Admin - A collection of MongoDB administrative functions
use MongoDB; use MongoDB::Admin; my $connection = MongoDB::Connection->new(host => 'localhost', port => 27017); my $admin = MongoDB::Admin->new('connection' => $connection); my $ops = $admin->current_op(); my $locked = $admin->fsync_lock_check(); $admin->fsync_lock(); $admin->fsync_unlock();
my $result = $database->current_op()
Print out the current operations running on the MongoDB server. akin to db.currentOp() at the mongo shell
my $result = $conn->fsync_lock_check()
Checks if a fsync lock is in place, returning 1 if present, 0 otherwise.
my $result = $conn->fsync_lock()
Force a fsync and then lock the database to write operations, does nothing if writes are already locked.
my $result = $conn->unlock()
Unlock's MongoDB from a prior fsync_lock operation.
David Burley <david@geek.net>
To install MongoDB::Admin, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MongoDB::Admin
CPAN shell
perl -MCPAN -e shell install MongoDB::Admin
For more information on module installation, please visit the detailed CPAN module installation guide.