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 f16b297 commit 6d2814dCopy full SHA for 6d2814d
lib/mongoid/contextual/aggregable/mongo.rb
@@ -27,7 +27,8 @@ module Mongo
27
# If no documents are found, then returned Hash will have
28
# count, sum of 0 and max, min, avg of nil.
29
def aggregates(field)
30
- result = collection.aggregate(pipeline(field), session: _session).to_a
+ hint = options[:hint]
31
+ result = collection.aggregate(pipeline(field), session: _session, hint: hint).to_a
32
if result.empty?
33
Aggregable::EMPTY_RESULT.dup
34
else
0 commit comments