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

Methods

allow_disk_use   explain   new  

Included Modules

Enumerable Immutable Iterable Explainable Loggable Retryable

Constants

REROUTE = 'Rerouting the Aggregation operation to the primary server.'.freeze   The reroute message.

@since 2.1.0

Attributes

pipeline  [R]  @return [ Array<Hash> ] pipeline The aggregation pipeline.
view  [R]  @return [ View ] view The collection view.

Public Class methods

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

Public Instance methods

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

Get the explain plan for the aggregation.

@example Get the explain plan for the aggregation.

  aggregation.explain

@return [ Hash ] The explain plan.

@since 2.0.0

[Validate]