| Class | Mongo::Collection::View::Aggregation |
| In: |
lib/mongo/collection/view/aggregation.rb
|
| Parent: | Object |
Provides behavior around an aggregation pipeline on a collection view.
@since 2.0.0
| REROUTE | = | 'Rerouting the Aggregation operation to the primary server.'.freeze |
The reroute message.
@since 2.1.0 |
| pipeline | [R] | @return [ Array<Hash> ] pipeline The aggregation pipeline. |
| view | [R] | @return [ View ] view The collection view. |
Initialize the aggregation for the provided collection view, pipeline and options.
@example Create the new aggregation view.
Aggregation.view.new(view, pipeline)
@param [ Collection::View ] view The collection view. @param [ Array<Hash> ] pipeline The pipeline of operations. @param [ Hash ] options The aggregation options.
@since 2.0.0
Set to true if disk usage is allowed during the aggregation.
@example Set disk usage flag.
aggregation.allow_disk_use(true)
@param [ true, false ] value The flag value.
@return [ true, false, Aggregation ] The aggregation if a value was
set or the value if used as a getter.
@since 2.0.0