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 behavior around combiners

Since:

  • 2.1.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#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



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

def requests
  @requests
end

Instance Method Details

#has_array_filters?Boolean

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 Whether one or more operation specifies the array_filters option.

Returns:

  • (Boolean)

    Whether one or more operation specifies the array_filters option.

Since:

  • 2.1.0



56
57
58
# File 'lib/mongo/bulk_write/combineable.rb', line 56

def has_array_filters?
  @has_array_filters
end

#has_collation?Boolean

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 Whether one or more operation specifies the collation option.

Returns:

  • (Boolean)

    Whether one or more operation specifies the collation option.

Since:

  • 2.1.0



50
51
52
# File 'lib/mongo/bulk_write/combineable.rb', line 50

def has_collation?
  @has_collation
end

#has_hint?Boolean

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 Whether one or more operation specifies the hint option.

Returns:

  • (Boolean)

    Whether one or more operation specifies the hint option.

Since:

  • 2.1.0



62
63
64
# File 'lib/mongo/bulk_write/combineable.rb', line 62

def has_hint?
  @has_hint
end

#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
45
46
# File 'lib/mongo/bulk_write/combineable.rb', line 41

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