summaryrefslogtreecommitdiff
path: root/jstests/mr1.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-10-01 17:15:44 -0400
committerEliot Horowitz <eliot@10gen.com>2009-10-01 17:15:44 -0400
commit529b27107003d7e302b661e7c990e9ae3014264e (patch)
tree1e16f3646e61c137f6b2f585112a97e28bf3d1ab /jstests/mr1.js
parent95baa00d459fd2ea5588277e90a98edab7394b79 (diff)
downloadmongo-529b27107003d7e302b661e7c990e9ae3014264e.tar.gz
fix return of mapreduce - ok if works, not ok if collection doesn't exist
Diffstat (limited to 'jstests/mr1.js')
-rw-r--r--jstests/mr1.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/jstests/mr1.js b/jstests/mr1.js
index f999b9d3d64..f50819803d5 100644
--- a/jstests/mr1.js
+++ b/jstests/mr1.js
@@ -25,6 +25,7 @@ r = function( key , values ){
};
res = db.runCommand( { mapreduce : "mr1" , map : m , reduce : r } );
+assert( res.ok , "not ok" );
assert.eq( 4 , res.numObjects , "A" );
x = db[res.result];
@@ -82,3 +83,10 @@ print( Date.timeFunc(
function(){
db.runCommand( { mapreduce : "mr1" , map : m , reduce : r } );
} , 10 ) );
+
+
+
+// test doesn't exist
+res = db.runCommand( { mapreduce : "lasjdlasjdlasjdjasldjalsdj12e" , map : m , reduce : r } );
+assert( ! res.ok , "should be not ok" );
+