NAME

MongoDB::Admin - A collection of MongoDB administrative functions

SYNOPSIS

    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();

    $admin->killOp($opid);

METHODS

current_op()

    my $result = $database->current_op()

Print out the current operations running on the MongoDB server. akin to db.currentOp() at the mongo shell

fsync_lock_check()

    my $result = $conn->fsync_lock_check()

Checks if a fsync lock is in place, returning 1 if present, 0 otherwise.

fsync_lock()

    my $result = $conn->fsync_lock()

Force a fsync and then lock the database to write operations, does nothing if writes are already locked.

unlock()

    my $result = $conn->unlock()

Unlock's MongoDB from a prior fsync_lock operation.

killOp()

    my $result = $conn->killOp($opid)

Kill MongoDB Query with opid $opid

AUTHOR

  David Burley <david@geek.net>