Class: Mongo::Operation::Indexes Private

Inherits:
Object
  • Object
show all
Includes:
Specifiable
Defined in:
lib/mongo/operation/indexes.rb,
lib/mongo/operation/indexes/legacy.rb,
lib/mongo/operation/indexes/op_msg.rb,
lib/mongo/operation/indexes/result.rb,
lib/mongo/operation/indexes/command.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A MongoDB indexes operation.

Since:

  • 2.0.0

Defined Under Namespace

Classes: Command, Legacy, OpMsg, Result

Constant Summary

Constants included from Specifiable

Specifiable::BYPASS_DOC_VALIDATION, Specifiable::COLLATION, Specifiable::COLL_NAME, Specifiable::CURSOR_COUNT, Specifiable::CURSOR_ID, Specifiable::CURSOR_IDS, Specifiable::DB_NAME, Specifiable::DELETE, Specifiable::DELETES, Specifiable::DOCUMENTS, Specifiable::INDEX, Specifiable::INDEXES, Specifiable::INDEX_NAME, Specifiable::MAX_TIME_MS, Specifiable::OPERATION_ID, Specifiable::OPTIONS, Specifiable::READ, Specifiable::READ_CONCERN, Specifiable::SELECTOR, Specifiable::START_TRANSACTION, Specifiable::TO_RETURN, Specifiable::UPDATE, Specifiable::UPDATES, Specifiable::USER, Specifiable::USER_NAME, Specifiable::WRITE_CONCERN

Instance Attribute Summary

Attributes included from Specifiable

#spec

Instance Method Summary collapse

Methods included from Specifiable

#==, #acknowledged_write?, #array_filters, #bypass_document_validation, #coll_name, #collation, #command, #cursor_count, #cursor_id, #cursor_ids, #db_name, #delete, #deletes, #documents, #index, #index_name, #indexes, #initialize, #max_time_ms, #namespace, #operation_id, #options, #ordered?, #read, #read_concern, #selector, #session, #start_transaction, #to_return, #txn_num, #update, #updates, #user, #user_name, #write_concern

Instance Method Details

#execute(server) ⇒ Mongo::Operation::Indexes::Result

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 the operation.

Examples:

operation.execute(server)

Parameters:

  • server (Mongo::Server)

    The server to send the operation to.

Returns:

Since:

  • 2.0.0



41
42
43
44
45
46
47
48
49
# File 'lib/mongo/operation/indexes.rb', line 41

def execute(server)
  if server.features.op_msg_enabled?
    OpMsg.new(spec).execute(server)
  elsif server.features.list_indexes_enabled?
    Command.new(spec).execute(server)
  else
    Legacy.new(spec).execute(server)
  end
end