def execute
      operation_id = Monitoring.next_operation_id
      result_combiner = ResultCombiner.new
      operations = op_combiner.combine

      client.send(:with_session, @options) do |session|
        operations.each do |operation|
          if single_statement?(operation)
            write_with_retry(session, write_concern) do |server, txn_num|
              execute_operation(
                  operation.keys.first,
                  operation.values.flatten,
                  server,
                  operation_id,
                  result_combiner,
                  session,
                  txn_num)
            end
          else
            legacy_write_with_retry do |server|
              execute_operation(
                  operation.keys.first,
                  operation.values.flatten,
                  server,
                  operation_id,
                  result_combiner,
                  session)
            end
          end
        end
      end
      result_combiner.result
    end
def execute
      operation_id = Monitoring.next_operation_id
      result_combiner = ResultCombiner.new
      operations = op_combiner.combine

      client.send(:with_session, @options) do |session|
        operations.each do |operation|
          if single_statement?(operation)
            write_with_retry(session, write_concern) do |server, txn_num|
              execute_operation(
                  operation.keys.first,
                  operation.values.flatten,
                  server,
                  operation_id,
                  result_combiner,
                  session,
                  txn_num)
            end
          else
            legacy_write_with_retry do |server|
              execute_operation(
                  operation.keys.first,
                  operation.values.flatten,
                  server,
                  operation_id,
                  result_combiner,
                  session)
            end
          end
        end
      end
      result_combiner.result
    end
Execute the bulk write operation.

 @example Execute the bulk write.
   bulk_write.execute

 @return [ Mongo::BulkWrite::Result ] The result.

 @since 2.1.0