diff options
author | clang-format-7.0.1 <adam.martin@10gen.com> | 2019-07-26 18:20:35 -0400 |
---|---|---|
committer | ADAM David Alan Martin <adam.martin@10gen.com> | 2019-07-27 11:02:23 -0400 |
commit | 134a4083953270e8a11430395357fb70a29047ad (patch) | |
tree | dd428e1230e31d92b20b393dfdc17ffe7fa79cb6 /jstests/core/apply_ops_dups.js | |
parent | 1e46b5049003f427047e723ea5fab15b5a9253ca (diff) | |
download | mongo-134a4083953270e8a11430395357fb70a29047ad.tar.gz |
SERVER-41772 Apply clang-format 7.0.1 to the codebase
Diffstat (limited to 'jstests/core/apply_ops_dups.js')
-rw-r--r-- | jstests/core/apply_ops_dups.js | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/jstests/core/apply_ops_dups.js b/jstests/core/apply_ops_dups.js index e18cd01d3f6..85bc04437a6 100644 --- a/jstests/core/apply_ops_dups.js +++ b/jstests/core/apply_ops_dups.js @@ -7,33 +7,33 @@ // ] (function() { - "use strict"; - var t = db.apply_ops_dups; - t.drop(); +"use strict"; +var t = db.apply_ops_dups; +t.drop(); - // Check that duplicate _id fields don't cause an error - assert.writeOK(t.insert({_id: 0, x: 1})); - assert.commandWorked(t.createIndex({x: 1}, {unique: true})); - var a = assert.commandWorked(db.adminCommand({ - applyOps: [ - {"op": "i", "ns": t.getFullName(), "o": {_id: 5, x: -1}}, - {"op": "i", "ns": t.getFullName(), "o": {_id: 5, x: 0}} - ] - })); - printjson(a); - printjson(t.find().toArray()); - assert.eq(2, t.find().count(), "Invalid insert worked"); - assert.eq(true, a.results[0], "Valid insert was rejected"); - assert.eq(true, a.results[1], "Insert should have not failed (but should be ignored"); - printjson(t.find().toArray()); +// Check that duplicate _id fields don't cause an error +assert.writeOK(t.insert({_id: 0, x: 1})); +assert.commandWorked(t.createIndex({x: 1}, {unique: true})); +var a = assert.commandWorked(db.adminCommand({ + applyOps: [ + {"op": "i", "ns": t.getFullName(), "o": {_id: 5, x: -1}}, + {"op": "i", "ns": t.getFullName(), "o": {_id: 5, x: 0}} + ] +})); +printjson(a); +printjson(t.find().toArray()); +assert.eq(2, t.find().count(), "Invalid insert worked"); +assert.eq(true, a.results[0], "Valid insert was rejected"); +assert.eq(true, a.results[1], "Insert should have not failed (but should be ignored"); +printjson(t.find().toArray()); - // Check that dups on non-id cause errors - var a = assert.commandFailedWithCode(db.adminCommand({ - applyOps: [ - {"op": "i", "ns": t.getFullName(), "o": {_id: 1, x: 0}}, - {"op": "i", "ns": t.getFullName(), "o": {_id: 2, x: 1}} - ] - }), - 11000 /*DuplicateKey*/); - assert.eq(2, t.find().count(), "Invalid insert worked"); +// Check that dups on non-id cause errors +var a = assert.commandFailedWithCode(db.adminCommand({ + applyOps: [ + {"op": "i", "ns": t.getFullName(), "o": {_id: 1, x: 0}}, + {"op": "i", "ns": t.getFullName(), "o": {_id: 2, x: 1}} + ] +}), + 11000 /*DuplicateKey*/); +assert.eq(2, t.find().count(), "Invalid insert worked"); })(); |