We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2562ff2 commit 998140aCopy full SHA for 998140a
lib/mongo/collection/view/aggregation.rb
@@ -42,7 +42,8 @@ class Aggregation
42
# @since 2.1.0
43
OPTIONS_MAP = {
44
:allow_disk_use => :allowDiskUse,
45
- :max_time_ms => :maxTimeMS
+ :max_time_ms => :maxTimeMS,
46
+ :explain => :explain
47
}
48
49
# Set to true if disk usage is allowed during the aggregation.
@@ -104,7 +105,13 @@ def aggregate_spec
104
105
106
def process_options
107
@agg_options ||= @options.each.reduce({}) do |opts, (key, value)|
- OPTIONS_MAP[key] ? opts.merge(OPTIONS_MAP[key] => value) : opts
108
+ if OPTIONS_MAP[key]
109
+ opts.merge(OPTIONS_MAP[key] => value)
110
+ elsif OPTIONS_MAP.values.include?(key)
111
+ opts.merge(key => value)
112
+ else
113
+ opts
114
+ end
115
end
116
117
0 commit comments