summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2021-12-10 15:13:11 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-12-10 21:31:46 +0000
commit207641bc5bf091a7e910ba88e12e1b1eff49874d (patch)
tree326bb11617f3c51f984c0fb197e5be1391646131 /jstests/noPassthrough
parent3a3f1d0b429427c0c836e6a1829a8a5ae3d8564a (diff)
downloadmongo-207641bc5bf091a7e910ba88e12e1b1eff49874d.tar.gz
SERVER-61980 validate collMod unique index option before processing no-op hidden parameter
Diffstat (limited to 'jstests/noPassthrough')
-rw-r--r--jstests/noPassthrough/hidden_index_noop.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/jstests/noPassthrough/hidden_index_noop.js b/jstests/noPassthrough/hidden_index_noop.js
index 9c8a9830093..b5407094af8 100644
--- a/jstests/noPassthrough/hidden_index_noop.js
+++ b/jstests/noPassthrough/hidden_index_noop.js
@@ -103,6 +103,11 @@ assert.eq(idxSpec.expireAfterSeconds, 10);
// option is a no-op, the operation as a whole will NOT be a no-op - instead, it will generate an
// oplog entry with only 'unique'. Ditto for the command result returned to the user.
if (collModIndexUniqueEnabled) {
+ assert.commandFailedWithCode(primaryDB.runCommand({
+ "collMod": primaryColl.getName(),
+ "index": {"name": "c_1", "unique": false, "hidden": false},
+ }),
+ ErrorCodes.BadValue);
result = assert.commandWorked(primaryDB.runCommand({
"collMod": primaryColl.getName(),
"index": {"name": "c_1", "unique": true, "hidden": false},