mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 01:21:03 +01:00
fix m/r sort SERVER-1652
This commit is contained in:
parent
087a79e4be
commit
a2f53c7ec9
10
db/mr.cpp
10
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<Cursor> temp = bestGuessCursor( mr.ns.c_str(), mr.filter, BSONObj() );
|
||||
shared_ptr<Cursor> temp = bestGuessCursor( mr.ns.c_str(), mr.filter, mr.sort );
|
||||
auto_ptr<ClientCursor> cursor( new ClientCursor( QueryOption_NoCursorTimeout , temp , mr.ns.c_str() ) );
|
||||
|
||||
Timer mt;
|
||||
|
Loading…
Reference in New Issue
Block a user