summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough
diff options
context:
space:
mode:
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"}));