summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2011-02-17 23:59:15 -0500
committerEliot Horowitz <eliot@10gen.com>2011-02-17 23:59:15 -0500
commitcd5a958c31b64de198f3289e5c3c734ba4f33ac5 (patch)
tree1782a5dee4e5188768c80d589028f2a54806f42e
parent8d4850ae65b5ca314a540090bd94714cf327b71b (diff)
downloadmongo-cd5a958c31b64de198f3289e5c3c734ba4f33ac5.tar.gz
multi/upsert is fine sharded, remove bad assert
-rw-r--r--jstests/sharding/update1.js7
-rw-r--r--s/strategy_shard.cpp2
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) ||