diff options
-rw-r--r-- | jstests/sharding/update1.js | 7 | ||||
-rw-r--r-- | s/strategy_shard.cpp | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/jstests/sharding/update1.js b/jstests/sharding/update1.js index 63d4bf6671d..635905015ca 100644 --- a/jstests/sharding/update1.js +++ b/jstests/sharding/update1.js @@ -42,5 +42,12 @@ assert.eq(err.code, 13123, 'key error code 2'); coll.update({_id:1, key:1}, {$set: {foo:2}}); assert.isnull(db.getLastError(), 'getLastError reset'); +coll.update( { key : 17 } , { $inc : { x : 5 } } , true ); +assert.eq( 5 , coll.findOne( { key : 17 } ).x , "up1" ) + +coll.update( { key : 18 } , { $inc : { x : 5 } } , true , true ); +assert.eq( 5 , coll.findOne( { key : 18 } ).x , "up2" ) + + s.stop() diff --git a/s/strategy_shard.cpp b/s/strategy_shard.cpp index b998c633cb2..2eca0c692da 100644 --- a/s/strategy_shard.cpp +++ b/s/strategy_shard.cpp @@ -190,8 +190,6 @@ namespace mongo { bool upsert = flags & UpdateOption_Upsert; bool multi = flags & UpdateOption_Multi; - uassert( 10202 , "can't mix multi and upsert and sharding" , ! ( upsert && multi ) ); - if (upsert) { uassert(8012, "can't upsert something without shard key", (manager->hasShardKey(toupdate) || |