diff options
author | Antonin Kral <a.kral@bobek.cz> | 2011-08-23 08:47:17 +0200 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2011-08-23 08:47:17 +0200 |
commit | cbe2d992e9cd1ea66af9fa91df006106775d3073 (patch) | |
tree | fca8e11a8ab7f063ae26802016068f9c814f6176 /db/dbcommands.cpp | |
parent | 64b33ee522375a8dc15be2875dfb7db4502259b0 (diff) | |
download | mongodb-cbe2d992e9cd1ea66af9fa91df006106775d3073.tar.gz |
Imported Upstream version 1.8.3
Diffstat (limited to 'db/dbcommands.cpp')
-rw-r--r-- | db/dbcommands.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/db/dbcommands.cpp b/db/dbcommands.cpp index cf0857a..59dd78c 100644 --- a/db/dbcommands.cpp +++ b/db/dbcommands.cpp @@ -851,6 +851,17 @@ namespace mongo { for ( list<BSONObj>::iterator i=all.begin(); i!=all.end(); i++ ) { BSONObj o = *i; + if ( o.getIntField("v") > 0 ) { + BSONObjBuilder b; + BSONObjIterator i( o ); + while ( i.more() ) { + BSONElement e = i.next(); + if ( str::equals( e.fieldName() , "v" ) ) + continue; + b.append( e ); + } + o = b.obj(); + } theDataFileMgr.insertWithObjMod( Namespace( toDeleteNs.c_str() ).getSisterNS( "system.indexes" ).c_str() , o , true ); } @@ -1753,6 +1764,7 @@ namespace mongo { } if ( cmdObj["help"].trueValue() ) { + client.curop()->ensureStarted(); stringstream ss; ss << "help for: " << c->name << " "; c->help( ss ); @@ -1777,6 +1789,7 @@ namespace mongo { if ( c->locktype() == Command::NONE ) { // we also trust that this won't crash + client.curop()->ensureStarted(); string errmsg; int ok = c->run( dbname , cmdObj , errmsg , result , fromRepl ); if ( ! ok ) @@ -1791,6 +1804,7 @@ namespace mongo { } mongolock lk( needWriteLock ); + client.curop()->ensureStarted(); Client::Context ctx( dbname , dbpath , &lk , c->requiresAuth() ); try { @@ -1824,7 +1838,6 @@ namespace mongo { returns true if ran a cmd */ bool _runCommands(const char *ns, BSONObj& _cmdobj, BufBuilder &b, BSONObjBuilder& anObjBuilder, bool fromRepl, int queryOptions) { - cc().curop()->ensureStarted(); string dbname = nsToDatabase( ns ); if( logLevel >= 1 ) |