Module: Mongo::BulkWrite::Combineable Private

Included in:
OrderedCombiner, UnorderedCombiner
Defined in:
lib/mongo/bulk_write/combineable.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Defines behaviour around combiners

Since:

  • 2.1.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#has_collationtrue, false (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns has_collation Whether one or more operations has a collation defined.

Returns:

  • (true, false)

    has_collation Whether one or more operations has a collation defined.

Since:

  • 2.1.0



29
30
31
# File 'lib/mongo/bulk_write/combineable.rb', line 29

def has_collation
  @has_collation
end

#requestsArray<Hash, BSON::Document> (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns requests The provided requests.

Returns:

  • (Array<Hash, BSON::Document>)

    requests The provided requests.

Since:

  • 2.1.0



26
27
28
# File 'lib/mongo/bulk_write/combineable.rb', line 26

def requests
  @requests
end

Instance Method Details

#initialize(requests) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Create the ordered combiner.

Examples:

Create the ordered combiner.

OrderedCombiner.new([{ insert_one: { _id: 0 }}])

Parameters:

  • requests (Array<Hash, BSON::Document>)

    The bulk requests.

Since:

  • 2.1.0



41
42
43
44
# File 'lib/mongo/bulk_write/combineable.rb', line 41

def initialize(requests)
  @requests = requests
  @has_collation = false
end