Method: Moped::Database#command

Defined in:
lib/moped/database.rb

#command(command) ⇒ Hash

Run command on the database.

Examples:

Run a command.

db.command(ismaster: 1)
# => { "master" => true, hosts: [] }

Parameters:

  • command (Hash)

    The command to run.

Returns:

  • (Hash)

    the result of the command.

Since:

  • 1.0.0



75
76
77
# File 'lib/moped/database.rb', line 75

def command(command)
  session.context.command name, command
end