diff --git a/db/mr.cpp b/db/mr.cpp index ad3a2c6f505..1afc682431a 100644 --- a/db/mr.cpp +++ b/db/mr.cpp @@ -176,11 +176,11 @@ namespace mongo { { // query options if ( cmdObj["query"].type() == Object ){ filter = cmdObj["query"].embeddedObjectUserCheck(); - q = filter; } - if ( cmdObj["sort"].type() == Object ) - q.sort( cmdObj["sort"].embeddedObjectUserCheck() ); + if ( cmdObj["sort"].type() == Object ){ + sort = cmdObj["sort"].embeddedObjectUserCheck(); + } if ( cmdObj["limit"].isNumber() ) limit = cmdObj["limit"].numberLong(); @@ -222,7 +222,7 @@ namespace mongo { // query options BSONObj filter; - Query q; + BSONObj sort; long long limit; // functions @@ -444,7 +444,7 @@ namespace mongo { readlock lock( mr.ns ); Client::Context ctx( mr.ns ); - shared_ptr temp = bestGuessCursor( mr.ns.c_str(), mr.filter, BSONObj() ); + shared_ptr temp = bestGuessCursor( mr.ns.c_str(), mr.filter, mr.sort ); auto_ptr cursor( new ClientCursor( QueryOption_NoCursorTimeout , temp , mr.ns.c_str() ) ); Timer mt;