diff options
Diffstat (limited to 'jstests/noPassthroughWithMongod/wt_roundtrip_creation_string.js')
-rw-r--r-- | jstests/noPassthroughWithMongod/wt_roundtrip_creation_string.js | 60 |
1 files changed, 29 insertions, 31 deletions
diff --git a/jstests/noPassthroughWithMongod/wt_roundtrip_creation_string.js b/jstests/noPassthroughWithMongod/wt_roundtrip_creation_string.js index 65ebef5ccf3..9664cfe4538 100644 --- a/jstests/noPassthroughWithMongod/wt_roundtrip_creation_string.js +++ b/jstests/noPassthroughWithMongod/wt_roundtrip_creation_string.js @@ -3,42 +3,40 @@ * collection or index with the same WiredTiger options. */ (function() { - 'use strict'; +'use strict'; - // Skip this test if not running with the "wiredTiger" storage engine. - if (db.serverStatus().storageEngine.name !== 'wiredTiger') { - jsTest.log('Skipping test because storageEngine is not "wiredTiger"'); - return; - } +// Skip this test if not running with the "wiredTiger" storage engine. +if (db.serverStatus().storageEngine.name !== 'wiredTiger') { + jsTest.log('Skipping test because storageEngine is not "wiredTiger"'); + return; +} - var collNamePrefix = 'wt_roundtrip_creation_string'; +var collNamePrefix = 'wt_roundtrip_creation_string'; - // Drop the collections used by the test to ensure that the create commands don't fail because - // the collections already exist. - db[collNamePrefix].source.drop(); - db[collNamePrefix].dest.drop(); +// Drop the collections used by the test to ensure that the create commands don't fail because +// the collections already exist. +db[collNamePrefix].source.drop(); +db[collNamePrefix].dest.drop(); - assert.commandWorked(db.createCollection(collNamePrefix + '.source')); - assert.commandWorked(db[collNamePrefix].source.createIndex({a: 1}, {name: 'a_1'})); +assert.commandWorked(db.createCollection(collNamePrefix + '.source')); +assert.commandWorked(db[collNamePrefix].source.createIndex({a: 1}, {name: 'a_1'})); - var collStats = db.runCommand({collStats: collNamePrefix + '.source'}); - assert.commandWorked(collStats); +var collStats = db.runCommand({collStats: collNamePrefix + '.source'}); +assert.commandWorked(collStats); - assert.commandWorked( - db.runCommand({ - create: collNamePrefix + '.dest', - storageEngine: {wiredTiger: {configString: collStats.wiredTiger.creationString}} - }), - 'unable to create collection using the creation string of another collection'); +assert.commandWorked(db.runCommand({ + create: collNamePrefix + '.dest', + storageEngine: {wiredTiger: {configString: collStats.wiredTiger.creationString}} +}), + 'unable to create collection using the creation string of another collection'); - assert.commandWorked(db.runCommand({ - createIndexes: collNamePrefix + '.dest', - indexes: [{ - key: {b: 1}, - name: 'b_1', - storageEngine: - {wiredTiger: {configString: collStats.indexDetails.a_1.creationString}} - }] - }), - 'unable to create index using the creation string of another index'); +assert.commandWorked(db.runCommand({ + createIndexes: collNamePrefix + '.dest', + indexes: [{ + key: {b: 1}, + name: 'b_1', + storageEngine: {wiredTiger: {configString: collStats.indexDetails.a_1.creationString}} + }] +}), + 'unable to create index using the creation string of another index'); })(); |