0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 17:10:48 +01:00
This commit is contained in:
Eliot Horowitz 2009-09-29 12:59:16 -04:00
parent b5b610c8b1
commit 966e13e27f
2 changed files with 14 additions and 2 deletions

View File

@ -255,7 +255,9 @@ namespace mongo {
_tlmr.reset( mrtl );
BSONObj q;
if ( cmdObj["query"].type() == Object )
q = cmdObj["query"].embeddedObjectUserCheck();
auto_ptr<DBClientCursor> cursor = db.query( ns , q );
while ( cursor->more() ){
BSONObj o = cursor->next();

View File

@ -37,9 +37,19 @@ assert.eq( 3 , z.keySet().length , "C" );
assert.eq( 2 , z.a , "D" );
assert.eq( 3 , z.b , "E" );
assert.eq( 3 , z.c , "F" );
x.drop();
res = db.runCommand( { mapreduce : "mr1" , map : m , reduce : r , query : { x : { "$gt" : 2 } } } );
assert.eq( 2 , res.numObjects , "B" );
x = db[res.result];
z = {};
x.find().forEach( function(a){ z[a.key] = a.value.count; } );
assert.eq( 1 , z.a , "C1" );
assert.eq( 1 , z.b , "C2" );
assert.eq( 2 , z.c , "C3" );
x.drop();
for ( i=5; i<1000; i++ ){
t.save( { x : i , tags : [ "b" , "d" ] } );