Don't check keys on Collection#map_reduce

This commit is contained in:
Kyle Banker 2010-07-21 08:23:55 -04:00
parent 476d856abb
commit 969ec6f644
2 changed files with 0 additions and 9 deletions

View File

@ -480,7 +480,6 @@ module Mongo
#
# @core mapreduce map_reduce-instance_method
def map_reduce(map, reduce, opts={})
opts.assert_valid_keys(:query, :sort, :limit, :finalize, :out, :keeptemp, :verbose, :raw)
map = BSON::Code.new(map) unless map.is_a?(BSON::Code)
reduce = BSON::Code.new(reduce) unless reduce.is_a?(BSON::Code)
raw = opts.delete(:raw)

View File

@ -453,14 +453,6 @@ class TestCollection < Test::Unit::TestCase
assert res["counts"]
assert res["timeMillis"]
end
def test_allows_only_valid_keys
m = Code.new("function() { emit(this.user_id, 1); }")
r = Code.new("function(k,vals) { return 1; }")
assert_raise ArgumentError do
@@test.map_reduce(m, r, :foo => true)
end
end
end
if @@version > "1.3.0"