Method: Mongoid::Contextual::MapReduce#scope

Defined in:
lib/mongoid/contextual/map_reduce.rb

#scope(object) ⇒ MapReduce

Adds a javascript object to the global scope of the map/reduce.

Examples:

Add an object to the global scope.

map_reduce.scope(name: value)

Parameters:

  • object (Hash)

    A hash of key/values for the global scope.

Returns:

Since:

  • 3.0.0



198
199
200
201
# File 'lib/mongoid/contextual/map_reduce.rb', line 198

def scope(object)
  command[:scope] = object
  self
end