Method: Moped::Node#command
- Defined in:
- lib/moped/node.rb
#command(database, cmd, options = {}) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Execute a command against a database.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/moped/node.rb', line 68 def command(database, cmd, = {}) operation = Protocol::Command.new(database, cmd, ) process(operation) do |reply| result = reply.documents.first if reply.command_failure? if reply. && auth.has_key?(database) login(database, *auth[database]) command(database, cmd, ) else raise Errors::OperationFailure.new(operation, result) end end result end end |