Method: Origin::Aggregable#unwind

Defined in:
lib/origin/aggregable.rb

#unwind(field) ⇒ Aggregable

Add an unwind ($unwind) to the aggregation pipeline.

Examples:

Add an unwind to the pipeline.

aggregable.unwind(:field)

Parameters:

  • field (String, Symbol)

    The name of the field to unwind.

Returns:

Since:

  • 2.0.0



82
83
84
85
86
# File 'lib/origin/aggregable.rb', line 82

def unwind(field)
  aggregation(field) do |pipeline|
    pipeline.unwind(field)
  end
end