Module: Mongoid::Contextual::Aggregable::None
- Included in:
- None
- Defined in:
- lib/mongoid/contextual/aggregable/none.rb
Overview
Contains behavior for aggregating values in null context.
Instance Method Summary collapse
- #aggregates(_field) ⇒ Hash deprecated Deprecated.
- #avg(_field) ⇒ nil deprecated Deprecated.
- #min(_field = nil) ⇒ nil (also: #max) deprecated Deprecated.
- #sum(_field = nil) ⇒ Integer deprecated Deprecated.
Instance Method Details
#aggregates(_field) ⇒ Hash
Deprecated.
Get all the aggregate values for the provided field in null context. Provided for interface consistency with Aggregable::Mongo.
19 20 21 |
# File 'lib/mongoid/contextual/aggregable/none.rb', line 19 def aggregates(_field) Aggregable::EMPTY_RESULT.dup end |
#avg(_field) ⇒ nil
Deprecated.
Always returns nil.
45 46 47 |
# File 'lib/mongoid/contextual/aggregable/none.rb', line 45 def avg(_field) nil end |
#min(_field = nil) ⇒ nil Also known as: max
Deprecated.
Always returns nil.
58 59 60 |
# File 'lib/mongoid/contextual/aggregable/none.rb', line 58 def min(_field = nil) nil end |
#sum(_field = nil) ⇒ Integer
Deprecated.
Always returns zero.
32 33 34 |
# File 'lib/mongoid/contextual/aggregable/none.rb', line 32 def sum(_field = nil) 0 end |