mongo 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +4 -0
- data/lib/mongo.rb +1 -1
- data/lib/mongo/collection.rb +1 -1
- data/mongo.gemspec +1 -1
- data/test/collection_test.rb +10 -0
- metadata +3 -3
data/HISTORY
CHANGED
data/lib/mongo.rb
CHANGED
data/lib/mongo/collection.rb
CHANGED
@@ -480,7 +480,7 @@ module Mongo
|
|
480
480
|
#
|
481
481
|
# @core mapreduce map_reduce-instance_method
|
482
482
|
def map_reduce(map, reduce, opts={})
|
483
|
-
opts.assert_valid_keys(:query, :sort, :limit, :finalize, :keeptemp, :verbose, :raw)
|
483
|
+
opts.assert_valid_keys(:query, :sort, :limit, :finalize, :out, :keeptemp, :verbose, :raw)
|
484
484
|
map = BSON::Code.new(map) unless map.is_a?(BSON::Code)
|
485
485
|
reduce = BSON::Code.new(reduce) unless reduce.is_a?(BSON::Code)
|
486
486
|
raw = opts.delete(:raw)
|
data/mongo.gemspec
CHANGED
data/test/collection_test.rb
CHANGED
@@ -439,6 +439,16 @@ class TestCollection < Test::Unit::TestCase
|
|
439
439
|
assert res["timeMillis"]
|
440
440
|
end
|
441
441
|
|
442
|
+
def test_map_reduce_with_output_collection
|
443
|
+
output_collection = "test-map-coll"
|
444
|
+
m = Code.new("function() { emit(this.user_id, 1); }")
|
445
|
+
r = Code.new("function(k,vals) { return 1; }")
|
446
|
+
res = @@test.map_reduce(m, r, :raw => true, :out => output_collection)
|
447
|
+
assert_equal output_collection, res["result"]
|
448
|
+
assert res["counts"]
|
449
|
+
assert res["timeMillis"]
|
450
|
+
end
|
451
|
+
|
442
452
|
def test_allows_only_valid_keys
|
443
453
|
m = Code.new("function() { emit(this.user_id, 1); }")
|
444
454
|
r = Code.new("function(k,vals) { return 1; }")
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 5
|
9
|
+
version: 1.0.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Jim Menard
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
prerelease: false
|
25
25
|
requirement: &id001 !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- - "
|
27
|
+
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
segments:
|
30
30
|
- 1
|