RUBY-331 fix sort on Collection#map_reduce

This commit is contained in:
Kyle Banker 2011-09-19 11:46:15 -04:00
parent e613880922
commit ec97cd6d53
1 changed files with 3 additions and 0 deletions

View File

@ -611,6 +611,9 @@ module Mongo
hash['map'] = map
hash['reduce'] = reduce
hash.merge! opts
if hash[:sort]
hash[:sort] = Mongo::Support.format_order_clause(hash[:sort])
end
result = @db.command(hash)
unless Mongo::Support.ok?(result)