Module: Mongo::Operation::CollectionsInfoOrListCollections

Includes:
PolymorphicLookup
Included in:
CollectionsInfo
Defined in:
lib/mongo/operation/shared/collections_info_or_list_collections.rb

Instance Method Summary collapse

Instance Method Details

#execute(server, client:) ⇒ Mongo::Operation::CollectionsInfo::Result, Mongo::Operation::ListCollections::Result

Execute the operation.

Examples:

operation.execute(server, client: nil)

Parameters:

  • server (Mongo::Server)

    The server to send the operation to.

  • client (Mongo::Client)

    The client that will be used to perform auto-encryption if it is necessary to encrypt the command being executed (optional).

Returns:



32
33
34
35
36
37
# File 'lib/mongo/operation/shared/collections_info_or_list_collections.rb', line 32

def execute(server, client:)
  server.with_connection do |connection|
    operation = final_operation(connection)
    operation.execute(connection, client: client)
  end
end