Method: Mongo::Collection::View::MapReduce#out

Defined in:
lib/mongo/collection/view/map_reduce.rb

#out(location = nil) ⇒ MapReduce, Hash

Set or get the output location for the operation.

Examples:

Set the output to inline.

map_reduce.out(inline: 1)

Set the output collection to merge.

map_reduce.out(merge: 'users')

Set the output collection to replace.

map_reduce.out(replace: 'users')

Set the output collection to reduce.

map_reduce.out(reduce: 'users')

Parameters:

  • location (Hash) (defaults to: nil)

    The output location details.

Returns:

  • (MapReduce, Hash)

    The new MapReduce operation or the value of the output location.

Since:

  • 2.0.0



165
166
167
# File 'lib/mongo/collection/view/map_reduce.rb', line 165

def out(location = nil)
  configure(:out, location)
end