lib/mongo/bulk_write/combineable.rb in mongo-2.12.4 vs lib/mongo/bulk_write/combineable.rb in mongo-2.13.0.beta1
- old
+ new
@@ -1,6 +1,6 @@
-# Copyright (C) 2015-2019 MongoDB, Inc.
+# Copyright (C) 2015-2020 MongoDB Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@@ -23,17 +23,10 @@
module Combineable
# @return [ Array<Hash, BSON::Document> ] requests The provided requests.
attr_reader :requests
- # @return [ true, false ] has_collation Whether one or more operations has a collation defined.
- attr_reader :has_collation
-
- # @return [ true, false ] has_array_filters Whether one or more operations specifies an array
- # filters option.
- attr_reader :has_array_filters
-
# Create the ordered combiner.
#
# @api private
#
# @example Create the ordered combiner.
@@ -44,9 +37,28 @@
# @since 2.1.0
def initialize(requests)
@requests = requests
@has_collation = false
@has_array_filters = false
+ @has_hint = false
+ end
+
+ # @return [ Boolean ] Whether one or more operation specifies the collation
+ # option.
+ def has_collation?
+ @has_collation
+ end
+
+ # @return [ Boolean ] Whether one or more operation specifies the
+ # array_filters option.
+ def has_array_filters?
+ @has_array_filters
+ end
+
+ # @return [ Boolean ] Whether one or more operation specifies the
+ # hint option.
+ def has_hint?
+ @has_hint
end
private
def combine_requests(ops)