Module: Mongo::Operation::Write::Bulk::Bulkable

Included in:
Delete, Insert, Update
Defined in:
lib/mongo/operation/write/bulk/bulkable.rb

Overview

Provides common behavior for bulk write operations. Note that #validate! is not called on operation results because they are merged at a higher level.

Since:

  • 2.1.0

Instance Method Summary collapse

Instance Method Details

#execute(server) ⇒ Result

Execute the bulk operation.

Examples:

Execute the operation.

operation.execute(server)

Parameters:

  • server (Mongo::Server)

    The server to send this operation to.

Returns:

  • (Result)

    The operation result.

Since:

  • 2.0.0



37
38
39
40
41
42
43
# File 'lib/mongo/operation/write/bulk/bulkable.rb', line 37

def execute(server)
  if server.features.write_command_enabled?
    execute_write_command(server)
  else
    execute_message(server)
  end
end