mongodb/mongoid · error · Mongoid::Errors::NoMapReduceOutput

No output location was specified for the map/reduce operatio

Error message

No output location was specified for the map/reduce operation.

What it means

Error "No output location was specified for the map/reduce operation." thrown in mongodb/mongoid.

Source

Thrown at lib/mongoid/contextual/map_reduce.rb:224

  class:    #{criteria.klass}
  map:      #{command[:map]}
  reduce:   #{command[:reduce]}
  finalize: #{command[:finalize]}
  out:      #{command[:out].inspect}>
)
      end

      # Returns the selector of the command spec.
      #
      # @return [ Hash ] The selector.
      def command
        @map_reduce.send(:map_reduce_spec)[:selector]
      end

      private

      def validate_out!
        raise Errors::NoMapReduceOutput.new({}) unless @map_reduce.out
      end

      def _session
        criteria.send(:_session)
      end
    end
  end
end

View on GitHub (pinned to 0da0e23d71)

When it happens

Trigger: Thrown at lib/mongoid/contextual/map_reduce.rb:224 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of mongodb/mongoid@0da0e23d71 (2026-08-23). Data as JSON: /api/errors/4ce126c2660bb4c7. Report an issue: GitHub.