| Class | Mongo::Collection::View::Builder::Aggregation |
| In: |
lib/mongo/collection/view/builder/aggregation.rb
|
| Parent: | Object |
Builds an aggregation command specification from the view and options.
@since 2.2.0
| MAPPINGS | = | BSON::Document.new( :allow_disk_use => 'allowDiskUse', :max_time_ms => 'maxTimeMS', # This is intentional; max_await_time_ms is an alias for maxTimeMS # used on getMore commands for change streams. :max_await_time_ms => 'maxTimeMS', :explain => 'explain', :bypass_document_validation => 'bypassDocumentValidation', :collation => 'collation', :hint => 'hint', :comment => 'comment' |
The mappings from ruby options to the aggregation options.
@since 2.2.0 |
| options | [R] | @return [ Hash ] options The map/reduce specific options. |
| pipeline | [R] | @return [ Array<Hash> ] pipeline The pipeline. |
| view | [R] | @return [ Collection::View ] view The collection view. |
Initialize the builder.
@example Initialize the builder.
Aggregation.new(map, reduce, view, options)
@param [ Array<Hash> ] pipeline The aggregation pipeline. @param [ Collection::View ] view The collection view. @param [ Hash ] options The map/reduce options.
@since 2.2.0
Get the specification to pass to the aggregation operation.
@example Get the specification.
builder.specification
@return [ Hash ] The specification.
@since 2.2.0