diff options
author | Dianna Hohensee <dianna.hohensee@10gen.com> | 2018-08-27 13:06:38 -0400 |
---|---|---|
committer | Dianna Hohensee <dianna.hohensee@10gen.com> | 2018-08-29 16:47:09 -0400 |
commit | 4cb0742947dabee476c9979cae39c728a21568d5 (patch) | |
tree | 8ec6baacaab48a11b20eae4781f32be1bdad6ec2 /jstests/noPassthroughWithMongod | |
parent | aa36a9e8ad8c98e828f1b53966672b368d973380 (diff) | |
download | mongo-4cb0742947dabee476c9979cae39c728a21568d5.tar.gz |
SERVER-36015 Remove references to system.namespaces and system.indexes
Diffstat (limited to 'jstests/noPassthroughWithMongod')
-rw-r--r-- | jstests/noPassthroughWithMongod/create_indexes_shell_helper.js | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/jstests/noPassthroughWithMongod/create_indexes_shell_helper.js b/jstests/noPassthroughWithMongod/create_indexes_shell_helper.js index 6d9937139ae..8a36f7ee11e 100644 --- a/jstests/noPassthroughWithMongod/create_indexes_shell_helper.js +++ b/jstests/noPassthroughWithMongod/create_indexes_shell_helper.js @@ -9,11 +9,8 @@ var commandsRan = []; var insertsRan = []; var mockMongo = { - forceWriteMode: function(mode) { - this._writeMode = mode; - }, writeMode: function() { - return this._writeMode; + return "commands"; }, getSlaveOk: function() { return true; @@ -22,10 +19,6 @@ commandsRan.push({db: db, cmd: cmd, opts: opts}); return {ok: 1.0}; }, - insert: function(db, indexSpecs, opts) { - insertsRan.push({db: db, indexSpecs: indexSpecs, opts: opts}); - return {ok: 1.0}; - }, getWriteConcern: function() { return null; }, @@ -58,8 +51,6 @@ db._mongo = mockMongo; db._session = new _DummyDriverSession(mockMongo); - mockMongo.forceWriteMode("commands"); - t.createIndexes([{x: 1}]); assert.eq(commandsRan.length, 1); assert(commandsRan[0].cmd.hasOwnProperty("createIndexes")); @@ -79,19 +70,6 @@ assert.eq(commandsRan.length, 1); assert(commandsRan[0].cmd.hasOwnProperty("createIndexes")); assert.eq(commandsRan[0].cmd["indexes"][0], {key: {a: 1}, name: "a_1"}); - - db.getMongo().forceWriteMode("compatibility"); - - commandsRan = []; - assert.eq(commandsRan.length, 0); - t.createIndex({b: 1}); - assert.eq(insertsRan.length, 1); - assert.eq(insertsRan[0]["indexSpecs"]["ns"], "test.create_indexes_shell_helper"); - assert.eq(insertsRan[0]["indexSpecs"]["key"], {b: 1}); - assert.eq(insertsRan[0]["indexSpecs"]["name"], "b_1"); - // getLastError is called in the course of the bulk insert - assert.eq(commandsRan.length, 1); - assert(commandsRan[0].cmd.hasOwnProperty("getlasterror")); } finally { db._mongo = mongo; db._session = new _DummyDriverSession(mongo); |