diff options
Diffstat (limited to 'jstests/core/capped_update.js')
-rw-r--r-- | jstests/core/capped_update.js | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/jstests/core/capped_update.js b/jstests/core/capped_update.js index 293cada4f8e..3ae434a8334 100644 --- a/jstests/core/capped_update.js +++ b/jstests/core/capped_update.js @@ -7,24 +7,23 @@ 'use strict'; var t = db.cannot_change_capped_size; t.drop(); - assert.commandWorked(db.createCollection(t.getName(), {capped: true, - size: 1024, - autoIndexId:false})); + assert.commandWorked( + db.createCollection(t.getName(), {capped: true, size: 1024, autoIndexId: false})); assert.eq(0, t.getIndexes().length, "the capped collection has indexes"); for (var j = 1; j <= 10; j++) { assert.writeOK(t.insert({_id: j, s: "Hello, World!"})); } - assert.writeOK(t.update({_id: 3}, {s: "Hello, Mongo!"})); // Mongo is same length as World + assert.writeOK(t.update({_id: 3}, {s: "Hello, Mongo!"})); // Mongo is same length as World assert.writeError(t.update({_id: 3}, {$set: {s: "Hello!"}})); assert.writeError(t.update({_id: 10}, {})); assert.writeError(t.update({_id: 10}, {s: "Hello, World!!!"})); - assert.commandWorked(t.getDB().runCommand({godinsert:t.getName(), obj:{a:2}})); - var doc = t.findOne({a:2}); + assert.commandWorked(t.getDB().runCommand({godinsert: t.getName(), obj: {a: 2}})); + var doc = t.findOne({a: 2}); assert.eq(undefined, doc["_id"], "now has _id after godinsert"); - assert.writeOK(t.update({a:2}, {$inc:{a:1}})); - doc = t.findOne({a:3}); + assert.writeOK(t.update({a: 2}, {$inc: {a: 1}})); + doc = t.findOne({a: 3}); assert.eq(undefined, doc["_id"], "now has _id after update"); })(); |