summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2016-10-19 16:23:00 -0400
committerTess Avitabile <tess.avitabile@mongodb.com>2016-10-24 11:13:07 -0400
commit064ed7fab88447bd5dd6bfc19dfef4dbf89d19f9 (patch)
tree314fbceecbed08cdf005210f2d036d4e123fbbb3 /jstests/noPassthrough
parent7154b9f7c81fdda492d2536e8ef7c434356d8ac6 (diff)
downloadmongo-064ed7fab88447bd5dd6bfc19dfef4dbf89d19f9.tar.gz
SERVER-26514 Create command should take idIndex option
Diffstat (limited to 'jstests/noPassthrough')
-rw-r--r--jstests/noPassthrough/index_version_v2.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/jstests/noPassthrough/index_version_v2.js b/jstests/noPassthrough/index_version_v2.js
index 0c8681f348b..8aebb35fdfb 100644
--- a/jstests/noPassthrough/index_version_v2.js
+++ b/jstests/noPassthrough/index_version_v2.js
@@ -149,6 +149,14 @@
indexSpec = getIndexSpecByName(testDB.index_version, "_id_");
assert.eq(1, indexSpec.v, tojson(indexSpec));
+ // Test that the _id index of a collection is created with v=1 when the
+ // featureCompatibilityVersion is 3.2 and an "idIndex" spec is provided without a version.
+ testDB.index_version.drop();
+ assert.commandWorked(
+ testDB.runCommand({create: "index_version", idIndex: {key: {_id: 1}, name: "_id_"}}));
+ indexSpec = getIndexSpecByName(testDB.index_version, "_id_");
+ assert.eq(1, indexSpec.v, tojson(indexSpec));
+
// Test that an index created on an existing collection is created with v=1 when the
// featureCompatibilityVersion is 3.2.
assert.commandWorked(testDB.index_version.createIndex({defaultToV1: 1}, {name: "defaultToV1"}));