class Mongo::Operation::Commands::DropDatabase

A MongoDB drop database operation.

@example Instantiate the operation.

Drop.new(selector: { dropDatabase: 'test' }, :db_name => 'test')

Initialization:

param [ Hash ] spec The specifications for the operation.

option spec :db_name [ String ] The name of the database.
option spec :selector [ Hash ] The drop database selector.
option spec :write_concern [ String ] The write concern to use.
  Only applied for server version >= 3.4.

@since 2.4.0

Private Instance Methods

message(server) click to toggle source
# File lib/mongo/operation/commands/drop_database.rb, line 38
def message(server)
  sel = update_selector_for_write_concern(selector, server)
  if server.features.op_msg_enabled?
    command_op_msg(server, sel, options)
  else
    Protocol::Query.new(db_name, query_coll, sel, options)
  end
end