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(context) ⇒ Result

Execute the bulk operation.

Examples:

Execute the operation.

operation.execute(context)

Parameters:

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(context)
  if context.features.write_command_enabled?
    execute_write_command(context)
  else
    execute_message(context)
  end
end