lib/operations/db_ops.js
function executeDbAdminCommand(db, command, options, callback) {
  db.s.topology.command('admin.$cmd', command, options, (err, result) => {
    // Did the user destroy the topology
    if (db.serverConfig && db.serverConfig.isDestroyed()) {
      return callback(new MongoError('topology was destroyed'));
    }

    if (err) return handleCallback(callback, err);
    handleCallback(callback, null, result.result);
  });
}
function executeDbAdminCommand(db, command, options, callback) {
  db.s.topology.command('admin.$cmd', command, options, (err, result) => {
    // Did the user destroy the topology
    if (db.serverConfig && db.serverConfig.isDestroyed()) {
      return callback(new MongoError('topology was destroyed'));
    }

    if (err) return handleCallback(callback, err);
    handleCallback(callback, null, result.result);
  });
}
function executeDbAdminCommand ( db , command , options , callback ) { db . s . topology . command ( 'admin.$cmd' , command , options , ( err , result ) => { // Did the user destroy the topology if ( db . serverConfig && db . serverConfig . isDestroyed ( ) ) { return callback ( new MongoError ( 'topology was destroyed' ) ) ; } if ( err ) return handleCallback ( callback , err ) ; handleCallback ( callback , null , result . result ) ; } ) ; }
Runs a command on the database as admin.

@method
@param {Db} db The Db instance on which to execute the command.
@param {object} command The command hash
@param {object} [options] Optional settings. See Db.prototype.executeDbAdminCommand for a list of options.
@param {Db~resultCallback} [callback] The command result callback
Runs a command on the database as admin .