diff options
Diffstat (limited to 's/d_logic.cpp')
-rw-r--r-- | s/d_logic.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/s/d_logic.cpp b/s/d_logic.cpp index 1e14a1eab6a..c6188c07bcc 100644 --- a/s/d_logic.cpp +++ b/s/d_logic.cpp @@ -29,6 +29,7 @@ #include "../db/commands.h" #include "../db/jsobj.h" #include "../db/dbmessage.h" +#include "../db/query.h" #include "../client/connpool.h" @@ -418,11 +419,13 @@ namespace mongo { // wait until cursors are clean cout << "WARNING: deleting data before ensuring no more cursors TODO" << endl; - dbtemprelease unlock; - - DBDirectClient client; - BSONObj removeFilter = finishToken.getObjectField( "query" ); - client.remove( ns , removeFilter ); + { + BSONObj removeFilter = finishToken.getObjectField( "query" ); + Client::Context ctx(ns); + long long num = deleteObjects( ns.c_str() , removeFilter , false , true ); + log() << "movechunk.finish deleted: " << num << endl; + result.appendNumber( "numDeleted" , num ); + } return true; } |