diff options
author | Dan Pasette <dan@10gen.com> | 2015-02-25 12:52:51 -0500 |
---|---|---|
committer | Dan Pasette <dan@mongodb.com> | 2015-02-25 12:52:51 -0500 |
commit | a59debcd8eba42cb844373385cf41b9561b69ab9 (patch) | |
tree | 99477a224571a941852ceda565569d997813869e | |
parent | 46d1b5fe392bdc46b0c062fc25ac7ee1136ea729 (diff) | |
download | mongo-a59debcd8eba42cb844373385cf41b9561b69ab9.tar.gz |
Revert "SERVER-17356 Rename 'storageEngine' to 'storage' in collection and index options"
This reverts commit 54f2c659779bfde7f7891f624d74c1eb01668b39.
-rw-r--r-- | jstests/core/apitest_db.js | 14 | ||||
-rw-r--r-- | jstests/sharding/sharding_system_namespaces.js | 4 | ||||
-rw-r--r-- | src/mongo/db/catalog/collection_options.cpp | 24 | ||||
-rw-r--r-- | src/mongo/db/catalog/collection_options.h | 4 | ||||
-rw-r--r-- | src/mongo/db/catalog/collection_options_test.cpp | 54 | ||||
-rw-r--r-- | src/mongo/db/catalog/database.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/catalog/index_catalog.cpp | 6 | ||||
-rw-r--r-- | src/mongo/db/global_environment_experiment.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp | 6 | ||||
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_index.h | 4 | ||||
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_index_test.cpp | 10 | ||||
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp | 6 | ||||
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h | 2 | ||||
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_record_store_test.cpp | 4 | ||||
-rw-r--r-- | src/mongo/dbtests/indexupdatetests.cpp | 14 |
15 files changed, 79 insertions, 77 deletions
diff --git a/jstests/core/apitest_db.js b/jstests/core/apitest_db.js index 3c272db34fc..f12f44c1aed 100644 --- a/jstests/core/apitest_db.js +++ b/jstests/core/apitest_db.js @@ -38,23 +38,23 @@ var found = false; db.getCollectionNames().forEach( function(x) { if (x == "test") found = true; }); assert(found, "found test.test in collection infos"); -// 'storage' in collection options must: +// storageEngine in collection options must: // - be a document // - contain at least one field of document type with the name of a registered storage engine. db.getCollection('test').drop(); var storageEngineName = db.serverStatus().storageEngine.name; -assert.commandFailed(db.createCollection('test', {storage: {}})); -assert.commandFailed(db.createCollection('test', {storage: {unknownStorageEngine: {}}})); +assert.commandFailed(db.createCollection('test', {storageEngine: {}})); +assert.commandFailed(db.createCollection('test', {storageEngine: {unknownStorageEngine: {}}})); var invalidStorageEngineOptions = {} invalidStorageEngineOptions[storageEngineName] = 12345; -assert.commandFailed(db.createCollection('test', {storage: invalidStorageEngineOptions})); +assert.commandFailed(db.createCollection('test', {storageEngine: invalidStorageEngineOptions})); -// Test round trip of 'storage' in collection options. +// Test round trip of storageEngine in collection options. // Assume that empty document for storageEngine-specific options is acceptable. var validStorageEngineOptions = {} validStorageEngineOptions[storageEngineName] = {}; db.getCollection('test').drop(); -assert.commandWorked(db.createCollection('test', {storage: validStorageEngineOptions})); +assert.commandWorked(db.createCollection('test', {storageEngine: validStorageEngineOptions})); var collections = db.getCollectionInfos(); found = false; for (var i = 0; i < collections.length; ++i) { @@ -63,7 +63,7 @@ for (var i = 0; i < collections.length; ++i) { continue; } found = true; - assert.docEq(validStorageEngineOptions, collection.options.storage, + assert.docEq(validStorageEngineOptions, collection.options.storageEngine, 'storage engine options not found in listCommands result'); } assert(found, "'test' collection not created"); diff --git a/jstests/sharding/sharding_system_namespaces.js b/jstests/sharding/sharding_system_namespaces.js index a880d15a6f0..7d8121da24a 100644 --- a/jstests/sharding/sharding_system_namespaces.js +++ b/jstests/sharding/sharding_system_namespaces.js @@ -27,12 +27,12 @@ if (db.serverBuildInfo().bits != 32) { var info = collectionsInfos.filter(function(c) { return c.name == "sharding_system_namespaces"; })[0]; - assert.eq(info.options.storage.wiredTiger.configString, "block_compressor=zlib"); + assert.eq(info.options.storageEngine.wiredTiger.configString, "block_compressor=zlib"); } db.createCollection("sharding_system_namespaces", { - storage: { + storageEngine: { wiredTiger: { configString: "block_compressor=zlib" } } }); diff --git a/src/mongo/db/catalog/collection_options.cpp b/src/mongo/db/catalog/collection_options.cpp index 570daa5a103..ba2a3ff5b6e 100644 --- a/src/mongo/db/catalog/collection_options.cpp +++ b/src/mongo/db/catalog/collection_options.cpp @@ -62,7 +62,7 @@ namespace mongo { flags = Flag_UsePowerOf2Sizes; flagsSet = false; temp = false; - storage = BSONObj(); + storageEngine = BSONObj(); } Status CollectionOptions::parse(const BSONObj& options) { @@ -124,14 +124,14 @@ namespace mongo { else if ( fieldName == "temp" ) { temp = e.trueValue(); } - else if (fieldName == "storage") { + else if (fieldName == "storageEngine") { // Storage engine-specific collection options. - // "storage" field must be of type "document". - // Every field inside "storage" has to be a document. + // "storageEngine" field must be of type "document". + // Every field inside "storageEngine" has to be a document. // Format: // { // ... - // storage: { + // storageEngine: { // storageEngine1: { // ... // }, @@ -142,26 +142,26 @@ namespace mongo { // ... // } if (e.type() != mongo::Object) { - return Status(ErrorCodes::BadValue, "'storage' has to be a document."); + return Status(ErrorCodes::BadValue, "'storageEngine' has to be a document."); } BSONObjIterator j(e.Obj()); if (!j.more()) { return Status(ErrorCodes::BadValue, - "Empty 'storage' options are invalid. " + "Empty 'storageEngine' options are invalid. " "Please remove, or include valid options."); } - // Loop through each provided storage. + // Loop through each provided storageEngine. while (j.more()) { BSONElement storageEngineElement = j.next(); StringData storageEngineName = storageEngineElement.fieldNameStringData(); if (storageEngineElement.type() != mongo::Object) { - return Status(ErrorCodes::BadValue, str::stream() << "'storage." << + return Status(ErrorCodes::BadValue, str::stream() << "'storageEngine." << storageEngineName << "' has to be an embedded document."); } } - storage = e.Obj().getOwned(); + storageEngine = e.Obj().getOwned(); } } @@ -192,8 +192,8 @@ namespace mongo { if ( temp ) b.appendBool( "temp", true ); - if (!storage.isEmpty()) { - b.append("storage", storage); + if (!storageEngine.isEmpty()) { + b.append("storageEngine", storageEngine); } return b.obj(); diff --git a/src/mongo/db/catalog/collection_options.h b/src/mongo/db/catalog/collection_options.h index b8128e1a487..09d53a5774b 100644 --- a/src/mongo/db/catalog/collection_options.h +++ b/src/mongo/db/catalog/collection_options.h @@ -44,6 +44,8 @@ namespace mongo { /** * Updates fields based on BSON document from client. + * If document contains a 'storageEngine' field, ensures that 'storageEngine' + * contains a single field of Object type. */ Status parse( const BSONObj& obj ); @@ -84,7 +86,7 @@ namespace mongo { bool temp; // Storage engine collection options. Always owned or empty. - BSONObj storage; + BSONObj storageEngine; }; } diff --git a/src/mongo/db/catalog/collection_options_test.cpp b/src/mongo/db/catalog/collection_options_test.cpp index d91b94d57cc..4bb94af2478 100644 --- a/src/mongo/db/catalog/collection_options_test.cpp +++ b/src/mongo/db/catalog/collection_options_test.cpp @@ -86,41 +86,41 @@ namespace mongo { } TEST(CollectionOptions, InvalidStorageEngineField) { - // "storage" field has to be an object if present. - ASSERT_NOT_OK( CollectionOptions().parse(fromjson("{storage: 1}"))); + // "storageEngine" field has to be an object if present. + ASSERT_NOT_OK( CollectionOptions().parse(fromjson("{storageEngine: 1}"))); - // Every field under "storage" has to be an object. + // Every field under "storageEngine" has to be an object. ASSERT_NOT_OK( CollectionOptions().parse(fromjson( - "{storage: {storageEngine1: 1}}"))); + "{storageEngine: {storageEngine1: 1}}"))); - // Empty "storage" not allowed + // Empty "storageEngine" not allowed ASSERT_NOT_OK( CollectionOptions().parse(fromjson( - "{storage: {}}"))); + "{storageEngine: {}}"))); } TEST(CollectionOptions, ParseEngineField) { CollectionOptions opts; ASSERT_OK(opts.parse(fromjson("{unknownField: 1, " - "storage: {storageEngine1: {x: 1, y: 2}, storageEngine2: {a: 1, b:2}}}"))); + "storageEngine: {storageEngine1: {x: 1, y: 2}, storageEngine2: {a: 1, b:2}}}"))); checkRoundTrip(opts); // Unrecognized field should not be present in BSON representation. BSONObj obj = opts.toBSON(); ASSERT_FALSE(obj.hasField("unknownField")); - // Check "storage" field. - ASSERT_TRUE(obj.hasField("storage")); - ASSERT_TRUE(obj.getField("storage").isABSONObj()); - BSONObj storage = obj.getObjectField("storage"); + // Check "storageEngine" field. + ASSERT_TRUE(obj.hasField("storageEngine")); + ASSERT_TRUE(obj.getField("storageEngine").isABSONObj()); + BSONObj storageEngine = obj.getObjectField("storageEngine"); - // Check individual storage fields. - ASSERT_TRUE(storage.getField("storageEngine1").isABSONObj()); - BSONObj storageEngine1 = storage.getObjectField("storageEngine1"); + // Check individual storage storageEngine fields. + ASSERT_TRUE(storageEngine.getField("storageEngine1").isABSONObj()); + BSONObj storageEngine1 = storageEngine.getObjectField("storageEngine1"); ASSERT_EQUALS(1, storageEngine1.getIntField("x")); ASSERT_EQUALS(2, storageEngine1.getIntField("y")); - ASSERT_TRUE(storage.getField("storageEngine2").isABSONObj()); - BSONObj storageEngine2 = storage.getObjectField("storageEngine2"); + ASSERT_TRUE(storageEngine.getField("storageEngine2").isABSONObj()); + BSONObj storageEngine2 = storageEngine.getObjectField("storageEngine2"); ASSERT_EQUALS(1, storageEngine2.getIntField("a")); ASSERT_EQUALS(2, storageEngine2.getIntField("b")); @@ -129,32 +129,32 @@ namespace mongo { TEST(CollectionOptions, ResetStorageEngineField) { CollectionOptions opts; ASSERT_OK(opts.parse(fromjson( - "{storage: {storageEngine1: {x: 1}}}"))); + "{storageEngine: {storageEngine1: {x: 1}}}"))); checkRoundTrip(opts); opts.reset(); - ASSERT_TRUE(opts.storage.isEmpty()); + ASSERT_TRUE(opts.storageEngine.isEmpty()); } TEST(CollectionOptions, ModifyStorageEngineField) { CollectionOptions opts; - // Directly modify storage field in collection options. - opts.storage = fromjson("{storageEngine1: {x: 1}}"); + // Directly modify storageEngine field in collection options. + opts.storageEngine = fromjson("{storageEngine1: {x: 1}}"); // Unrecognized field should not be present in BSON representation. BSONObj obj = opts.toBSON(); ASSERT_FALSE(obj.hasField("unknownField")); - // Check "storage" field. - ASSERT_TRUE(obj.hasField("storage")); - ASSERT_TRUE(obj.getField("storage").isABSONObj()); - BSONObj storage = obj.getObjectField("storage"); + // Check "storageEngine" field. + ASSERT_TRUE(obj.hasField("storageEngine")); + ASSERT_TRUE(obj.getField("storageEngine").isABSONObj()); + BSONObj storageEngine = obj.getObjectField("storageEngine"); - // Check individual storage fields. - ASSERT_TRUE(storage.getField("storageEngine1").isABSONObj()); - BSONObj storageEngine1 = storage.getObjectField("storageEngine1"); + // Check individual storage storageEngine fields. + ASSERT_TRUE(storageEngine.getField("storageEngine1").isABSONObj()); + BSONObj storageEngine1 = storageEngine.getObjectField("storageEngine1"); ASSERT_EQUALS(1, storageEngine1.getIntField("x")); } } diff --git a/src/mongo/db/catalog/database.cpp b/src/mongo/db/catalog/database.cpp index a67e3f91f1b..726032a46c0 100644 --- a/src/mongo/db/catalog/database.cpp +++ b/src/mongo/db/catalog/database.cpp @@ -616,7 +616,7 @@ namespace mongo { if ( !status.isOK() ) return status; - status = validateStorageOptions(collectionOptions.storage, + status = validateStorageOptions(collectionOptions.storageEngine, &StorageEngine::Factory::validateCollectionStorageOptions); if ( !status.isOK() ) return status; diff --git a/src/mongo/db/catalog/index_catalog.cpp b/src/mongo/db/catalog/index_catalog.cpp index f8504739c04..3e00ed23121 100644 --- a/src/mongo/db/catalog/index_catalog.cpp +++ b/src/mongo/db/catalog/index_catalog.cpp @@ -537,17 +537,17 @@ namespace { } } - BSONElement storageEngineElement = spec.getField("storage"); + BSONElement storageEngineElement = spec.getField("storageEngine"); if (storageEngineElement.eoo()) { return Status::OK(); } if (storageEngineElement.type() != mongo::Object) { - return Status(ErrorCodes::BadValue, "'storage' has to be a document."); + return Status(ErrorCodes::BadValue, "'storageEngine' has to be a document."); } BSONObj storageEngineOptions = storageEngineElement.Obj(); if (storageEngineOptions.isEmpty()) { return Status(ErrorCodes::BadValue, - "Empty 'storage' options are invalid. " + "Empty 'storageEngine' options are invalid. " "Please remove, or include valid options."); } diff --git a/src/mongo/db/global_environment_experiment.cpp b/src/mongo/db/global_environment_experiment.cpp index 8822149893e..8fa6ad696db 100644 --- a/src/mongo/db/global_environment_experiment.cpp +++ b/src/mongo/db/global_environment_experiment.cpp @@ -87,7 +87,7 @@ namespace mongo { StringData storageEngineName = storageElement.fieldNameStringData(); if (storageElement.type() != mongo::Object) { return Status(ErrorCodes::BadValue, str::stream() - << "'storage." << storageElement.fieldNameStringData() + << "'storageEngine." << storageElement.fieldNameStringData() << "' has to be an embedded document."); } diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp index 96a2e9970e8..0f854078e07 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp @@ -161,11 +161,11 @@ namespace { // Raise an error about unrecognized fields that may be introduced in newer versions of // this storage engine. // Ensure that 'configString' field is a string. Raise an error if this is not the case. - BSONElement storageEngineElement = desc.getInfoElement("storage"); + BSONElement storageEngineElement = desc.getInfoElement("storageEngine"); if (storageEngineElement.isABSONObj()) { - BSONObj storage = storageEngineElement.Obj(); + BSONObj storageEngine = storageEngineElement.Obj(); StatusWith<std::string> parseStatus = - parseIndexOptions(storage.getObjectField(kWiredTigerEngineName)); + parseIndexOptions(storageEngine.getObjectField(kWiredTigerEngineName)); if (!parseStatus.isOK()) { return parseStatus; } diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_index.h b/src/mongo/db/storage/wiredtiger/wiredtiger_index.h index e61e295cd29..81f6aa57c1f 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_index.h +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_index.h @@ -47,7 +47,7 @@ namespace mongo { /** * Parses index options for wired tiger configuration string suitable for table creation. - * The document 'options' is typically obtained from the 'storage.wiredTiger' field + * The document 'options' is typically obtained from the 'storageEngine.wiredTiger' field * of an IndexDescriptor's info object. */ static StatusWith<std::string> parseIndexOptions(const BSONObj& options); @@ -57,7 +57,7 @@ namespace mongo { * Configuration string is constructed from: * built-in defaults * 'extraConfig' - * storage.wiredTiger.configString in index descriptor's info object. + * storageEngine.wiredTiger.configString in index descriptor's info object. * Performs simple validation on the supplied parameters. * Returns error status if validation fails. * Note that even if this function returns an OK status, WT_SESSION:create() may still diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_index_test.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_index_test.cpp index 873f4577764..11e14e6b33e 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_index_test.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_index_test.cpp @@ -101,7 +101,7 @@ namespace mongo { } TEST(WiredTigerIndexTest, GenerateCreateStringEmptyDocument) { - BSONObj spec = fromjson("{storage: {wiredTiger: {}}}"); + BSONObj spec = fromjson("{storageEngine: {wiredTiger: {}}}"); IndexDescriptor desc(NULL, "", spec); StatusWith<std::string> result = WiredTigerIndex::generateCreateString("", desc); const Status& status = result.getStatus(); @@ -110,7 +110,7 @@ namespace mongo { } TEST(WiredTigerIndexTest, GenerateCreateStringUnknownField) { - BSONObj spec = fromjson("{storage: {wiredTiger: {unknownField: 1}}}"); + BSONObj spec = fromjson("{storageEngine: {wiredTiger: {unknownField: 1}}}"); IndexDescriptor desc(NULL, "", spec); StatusWith<std::string> result = WiredTigerIndex::generateCreateString("", desc); const Status& status = result.getStatus(); @@ -119,7 +119,7 @@ namespace mongo { } TEST(WiredTigerIndexTest, GenerateCreateStringNonStringConfig) { - BSONObj spec = fromjson("{storage: {wiredTiger: {configString: 12345}}}"); + BSONObj spec = fromjson("{storageEngine: {wiredTiger: {configString: 12345}}}"); IndexDescriptor desc(NULL, "", spec); StatusWith<std::string> result = WiredTigerIndex::generateCreateString("", desc); const Status& status = result.getStatus(); @@ -128,7 +128,7 @@ namespace mongo { } TEST(WiredTigerIndexTest, GenerateCreateStringEmptyConfigString) { - BSONObj spec = fromjson("{storage: {wiredTiger: {configString: ''}}}"); + BSONObj spec = fromjson("{storageEngine: {wiredTiger: {configString: ''}}}"); IndexDescriptor desc(NULL, "", spec); StatusWith<std::string> result = WiredTigerIndex::generateCreateString("", desc); const Status& status = result.getStatus(); @@ -137,7 +137,7 @@ namespace mongo { } TEST(WiredTigerIndexTest, GenerateCreateStringValidConfigFormat) { - BSONObj spec = fromjson("{storage: {wiredTiger: {configString: 'abc=def'}}}"); + BSONObj spec = fromjson("{storageEngine: {wiredTiger: {configString: 'abc=def'}}}"); IndexDescriptor desc(NULL, "", spec); StatusWith<std::string> result = WiredTigerIndex::generateCreateString("", desc); const Status& status = result.getStatus(); diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp index 594a6608427..b22573b2826 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp @@ -118,11 +118,11 @@ namespace { // Warn about unrecognized fields that may be introduced in newer versions of this // storage engine instead of raising an error. // Ensure that 'configString' field is a string. Warn if this is not the case. - BSONForEach(elem, options.storage.getObjectField(kWiredTigerEngineName)) { + BSONForEach(elem, options.storageEngine.getObjectField(kWiredTigerEngineName)) { if (elem.fieldNameStringData() == "configString") { if (elem.type() != String) { return StatusWith<std::string>(ErrorCodes::TypeMismatch, str::stream() - << "storage.wiredTiger.configString " + << "storageEngine.wiredTiger.configString " << "must be a string. " << "Not adding 'configString' value " << elem << " to collection configuration"); @@ -135,7 +135,7 @@ namespace { return StatusWith<std::string>(ErrorCodes::InvalidOptions, str::stream() << '\'' << elem.fieldNameStringData() << '\'' << " is not a supported option in " - << "storage.wiredTiger"); + << "storageEngine.wiredTiger"); } } diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h index 666548324a6..e076db94728 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h @@ -72,7 +72,7 @@ namespace mongo { * Creates a configuration string suitable for 'config' parameter in WT_SESSION::create(). * Configuration string is constructed from: * built-in defaults - * storage.wiredTiger.configString in 'options' + * storageEngine.wiredTiger.configString in 'options' * 'extraStrings' * Performs simple validation on the supplied parameters. * Returns error status if validation fails. diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store_test.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store_test.cpp index f884e51f6b5..efecfe86c56 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store_test.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store_test.cpp @@ -152,7 +152,7 @@ namespace mongo { TEST(WiredTigerRecordStoreTest, GenerateCreateStringUnknownField) { CollectionOptions options; - options.storage = fromjson("{wiredTiger: {unknownField: 1}}"); + options.storageEngine = fromjson("{wiredTiger: {unknownField: 1}}"); StatusWith<std::string> result = WiredTigerRecordStore::generateCreateString("", options, ""); const Status& status = result.getStatus(); ASSERT_NOT_OK(status); @@ -161,7 +161,7 @@ namespace mongo { TEST(WiredTigerRecordStoreTest, GenerateCreateStringNonStringConfig) { CollectionOptions options; - options.storage = fromjson("{wiredTiger: {configString: 12345}}"); + options.storageEngine = fromjson("{wiredTiger: {configString: 12345}}"); StatusWith<std::string> result = WiredTigerRecordStore::generateCreateString("", options, ""); const Status& status = result.getStatus(); ASSERT_NOT_OK(status); diff --git a/src/mongo/dbtests/indexupdatetests.cpp b/src/mongo/dbtests/indexupdatetests.cpp index 0fb0a165ca0..30ac55d7389 100644 --- a/src/mongo/dbtests/indexupdatetests.cpp +++ b/src/mongo/dbtests/indexupdatetests.cpp @@ -853,23 +853,23 @@ namespace IndexUpdateTests { class StorageEngineOptions : public IndexBuildBase { public: void run() { - // "storage" field has to be an object if present. + // "storageEngine" field has to be an object if present. ASSERT_NOT_OK(createIndex("unittest", _createSpec(12345))); - // 'storage' must not be empty. + // 'storageEngine' must not be empty. ASSERT_NOT_OK(createIndex("unittest", _createSpec(BSONObj()))); - // Every field under "storage" must match a registered storage engine. + // Every field under "storageEngine" must match a registered storage engine. ASSERT_NOT_OK(createIndex("unittest", _createSpec(BSON("unknownEngine" << BSONObj())))); // Testing with 'wiredTiger' because the registered storage engine factory - // supports custom index options under 'storage'. + // supports custom index options under 'storageEngine'. const std::string storageEngineName = "wiredTiger"; // Run 'wiredTiger' tests if the storage engine is supported. if (getGlobalEnvironment()->isRegisteredStorageEngine(storageEngineName)) { - // Every field under "storage" has to be an object. + // Every field under "storageEngine" has to be an object. ASSERT_NOT_OK(createIndex("unittest", _createSpec(BSON(storageEngineName << 1)))); // Storage engine options must pass validation by the storage engine factory. @@ -888,11 +888,11 @@ namespace IndexUpdateTests { } protected: template <typename T> - BSONObj _createSpec(T storageValue) { + BSONObj _createSpec(T storageEngineValue) { return BSON("name" << "super2" << "ns" << _ns << "key" << BSON("a" << 1) - << "storage" << storageValue); + << "storageEngine" << storageEngineValue); } }; |