refactoring updateObjects return to be cleaner and so can work with multi-object update SERVER-268

This commit is contained in:
Eliot Horowitz
2009-10-21 15:18:21 -04:00
parent feb2a40d5f
commit 4774b56bf2
6 changed files with 50 additions and 39 deletions

View File

@@ -358,8 +358,8 @@ namespace mongo {
CurOp& currentOp = *client.curop();
strncpy(currentOp.query, s.c_str(), sizeof(currentOp.query)-2);
}
bool updatedExisting = updateObjects(ns, toupdate, query, upsert, ss, multi);
recordUpdate( updatedExisting, ( upsert || updatedExisting ) ? 1 : 0 ); // for getlasterror
UpdateResult res = updateObjects(ns, toupdate, query, upsert, multi, ss, true);
recordUpdate( res.existing , res.num ); // for getlasterror
}
void receivedDelete(Message& m, stringstream &ss) {