diff options
Diffstat (limited to 'db/update.cpp')
-rw-r--r-- | db/update.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/db/update.cpp b/db/update.cpp index 7049fff..6b9df9c 100644 --- a/db/update.cpp +++ b/db/update.cpp @@ -807,12 +807,8 @@ namespace mongo { continue; } - if ( modsIsIndexed && multi ){ - c->noteLocation(); - } - const BSONObj& onDisk = loc.obj(); - + ModSet * useMods = mods.get(); bool forceRewrite = false; @@ -826,6 +822,11 @@ namespace mongo { auto_ptr<ModSetState> mss = useMods->prepare( onDisk ); + bool indexHack = multi && ( modsIsIndexed || ! mss->canApplyInPlace() ); + + if ( indexHack ) + c->noteLocation(); + if ( modsIsIndexed <= 0 && mss->canApplyInPlace() ){ mss->applyModsInPlace();// const_cast<BSONObj&>(onDisk) ); @@ -868,7 +869,7 @@ namespace mongo { numModded++; if ( ! multi ) break; - if ( multi && modsIsIndexed ) + if ( indexHack ) c->checkLocation(); continue; } |