diff options
Diffstat (limited to 'jstests/sharding/key_many.js')
-rw-r--r-- | jstests/sharding/key_many.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/jstests/sharding/key_many.js b/jstests/sharding/key_many.js index f40d0aa3e8b..4becd6746ce 100644 --- a/jstests/sharding/key_many.js +++ b/jstests/sharding/key_many.js @@ -137,12 +137,12 @@ for ( var i=0; i<types.length; i++ ){ assert.eq( 1 , c.find( { xx : { $exists : true } } ).count() , curT.name + " xx 2 " ); assert.eq( curT.values[3] , getKey( c.findOne( { xx : 17 } ) ) , curT.name + " xx 3 " ); - c.update( makeObjectDotted( curT.values[3] ) , { $set : { xx : 17 } } , {upsert: true}); - assert.eq( null , db.getLastError() , curT.name + " upserts should work if they include the shard key in the query" ); + assert.writeOK(c.update( makeObjectDotted( curT.values[3] ), + { $set: { xx: 17 }}, + { upsert: true })); + + assert.commandWorked(c.ensureIndex( { _id: 1 } , { unique: true } )); - c.ensureIndex( { _id : 1 } , { unique : true } ); - assert.eq( null , db.getLastError() , curT.name + " creating _id index should be ok" ); - // multi update var mysum = 0; c.find().forEach( function(z){ mysum += z.xx || 0; } ); |