Class: Daodalus::DSL::Aggregation::Unwind

Inherits:
Object
  • Object
show all
Includes:
Daodalus::DSL::Aggregations
Defined in:
lib/daodalus/dsl/aggregation/unwind.rb

Instance Method Summary collapse

Methods included from Daodalus::DSL::Aggregations

#aggregate, #group, #limit, #match, #pipeline, #project, #skip, #sort, #unwind

Constructor Details

#initialize(dao, aggregations, field) ⇒ Unwind

Returns a new instance of Unwind.



7
8
9
10
11
# File 'lib/daodalus/dsl/aggregation/unwind.rb', line 7

def initialize(dao, aggregations, field)
  @dao          = dao
  @aggregations = aggregations
  @field        = field
end

Instance Method Details

#to_aggregationObject



13
14
15
# File 'lib/daodalus/dsl/aggregation/unwind.rb', line 13

def to_aggregation
  { '$unwind' => "$#{field}" }
end