diff options
author | William Schultz <william.schultz@mongodb.com> | 2019-07-02 17:22:53 -0400 |
---|---|---|
committer | William Schultz <william.schultz@mongodb.com> | 2019-08-13 16:58:17 -0400 |
commit | a9df903dfdd072f270021f34af4d59de87fb30ea (patch) | |
tree | 9e0e82b640fe22dd9ee82cbd90b0b9ccff571a96 /jstests/core/collation.js | |
parent | 4605de0e64aa4e57487e620f91e5de52615a1941 (diff) | |
download | mongo-a9df903dfdd072f270021f34af4d59de87fb30ea.tar.gz |
SERVER-39576 Remove the 'doTxn' command
(cherry picked from commit 285c39607ee33aea0d6aff15cfaca37d0956ab50)
Diffstat (limited to 'jstests/core/collation.js')
-rw-r--r-- | jstests/core/collation.js | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/jstests/core/collation.js b/jstests/core/collation.js index 99623d18b7e..0118ffb3a5a 100644 --- a/jstests/core/collation.js +++ b/jstests/core/collation.js @@ -1821,55 +1821,6 @@ if (!isMongos) { assert.eq(8, coll.findOne({_id: "foo"}).x); } -// doTxn -if (FixtureHelpers.isReplSet(db) && !isMongos && isWiredTiger(db)) { - const session = db.getMongo().startSession(); - const sessionDb = session.getDatabase(db.getName()); - - // Use majority write concern to clear the drop-pending that can cause lock conflicts with - // transactions. - coll.drop({writeConcern: {w: "majority"}}); - - assert.commandWorked( - db.createCollection("collation", {collation: {locale: "en_US", strength: 2}})); - assert.writeOK(coll.insert({_id: "foo", x: 5, str: "bar"})); - - // preCondition.q respects collection default collation. - assert.commandFailed(sessionDb.runCommand({ - doTxn: [{op: "u", ns: coll.getFullName(), o2: {_id: "foo"}, o: {$set: {x: 6}}}], - preCondition: [{ns: coll.getFullName(), q: {_id: "not foo"}, res: {str: "bar"}}], - txnNumber: NumberLong("0") - })); - assert.eq(5, coll.findOne({_id: "foo"}).x); - assert.commandWorked(sessionDb.runCommand({ - doTxn: [{op: "u", ns: coll.getFullName(), o2: {_id: "foo"}, o: {$set: {x: 6}}}], - preCondition: [{ns: coll.getFullName(), q: {_id: "FOO"}, res: {str: "bar"}}], - txnNumber: NumberLong("1") - })); - assert.eq(6, coll.findOne({_id: "foo"}).x); - - // preCondition.res respects collection default collation. - assert.commandFailed(sessionDb.runCommand({ - doTxn: [{op: "u", ns: coll.getFullName(), o2: {_id: "foo"}, o: {$set: {x: 7}}}], - preCondition: [{ns: coll.getFullName(), q: {_id: "foo"}, res: {str: "not bar"}}], - txnNumber: NumberLong("2") - })); - assert.eq(6, coll.findOne({_id: "foo"}).x); - assert.commandWorked(sessionDb.runCommand({ - doTxn: [{op: "u", ns: coll.getFullName(), o2: {_id: "foo"}, o: {$set: {x: 7}}}], - preCondition: [{ns: coll.getFullName(), q: {_id: "foo"}, res: {str: "BAR"}}], - txnNumber: NumberLong("3") - })); - assert.eq(7, coll.findOne({_id: "foo"}).x); - - // <operation>.o2 respects collection default collation. - assert.commandWorked(sessionDb.runCommand({ - doTxn: [{op: "u", ns: coll.getFullName(), o2: {_id: "FOO"}, o: {$set: {x: 8}}}], - txnNumber: NumberLong("4") - })); - assert.eq(8, coll.findOne({_id: "foo"}).x); -} - // Test that the collection created with the "cloneCollectionAsCapped" command inherits the // default collation of the corresponding collection. We skip running this command in a sharded // cluster because it isn't supported by mongos. |