Aggregation — Documentation by YARD 0.9.37 (original) (raw)
Class: Mongo::Collection::View::Aggregation
Inherits:
Object
- Object
- Mongo::Collection::View::Aggregation show all
Includes:
Defined in:
lib/mongo/collection/view/aggregation.rb,
lib/mongo/collection/view/aggregation/behavior.rb
Overview
Provides behavior around an aggregation pipeline on a collection view.
Defined Under Namespace
Modules: Behavior
Constant Summary
Constants included from Loggable
Constants included from Explainable
Explainable::ALL_PLANS_EXECUTION, Explainable::EXECUTION_STATS, Explainable::QUERY_PLANNER
Instance Attribute Summary collapse
- #pipeline ⇒ Array readonly
Pipeline The aggregation pipeline.
Attributes included from Behavior
Attributes included from Mongo::CursorHost
Attributes included from Immutable
Instance Method Summarycollapse
- #initialize(view, pipeline, options = {}) ⇒ Aggregation constructor
Initialize the aggregation for the provided collection view, pipeline and options.
Methods included from Behavior
#allow_disk_use, #explain, #timeout_ms, #write?
Methods included from Retryable
#read_worker, #select_server, #write_worker
Methods included from Loggable
#log_debug, #log_error, #log_fatal, #log_info, #log_warn, #logger
Methods included from Explainable
Methods included from Iterable
Methods included from Mongo::CursorHost
Constructor Details
#initialize(view, pipeline, options = {}) ⇒ Aggregation
Initialize the aggregation for the provided collection view, pipeline and options.
| 68 69 70 71 72 73 74 75 | # File 'lib/mongo/collection/view/aggregation.rb', line 68 def initialize(view, pipeline, options = {}) perform_setup(view, options) do @pipeline = pipeline.dup unless Mongo.broken_view_aggregate || view.filter.empty? @pipeline.unshift(:$match => view.filter) end end end | | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
Instance Attribute Details
#pipeline ⇒ Array
Returns pipeline The aggregation pipeline.
31 32 33 | # File 'lib/mongo/collection/view/aggregation.rb', line 31 def pipeline @pipeline end |
---|