Module: Mongo::Operation::Executable

Overview

Shared executable behavior of operations.

Since:

  • 2.5.2

Instance Method Summary collapse

Instance Method Details

#do_execute(server, client, options = {}) ⇒ Object

Since:

  • 2.5.2



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/mongo/operation/shared/executable.rb', line 25

def do_execute(server, client, options = {})
  unpin_maybe(session) do
    add_error_labels do
      add_server_diagnostics(server) do
        get_result(server, client, options).tap do |result|
          process_result(result, server)
        end
      end
    end
  end
end

#execute(server, client:, options: {}) ⇒ Object

Since:

  • 2.5.2



37
38
39
40
41
# File 'lib/mongo/operation/shared/executable.rb', line 37

def execute(server, client:, options: {})
  do_execute(server, client, options).tap do |result|
    validate_result(result, server)
  end
end