summaryrefslogtreecommitdiff
path: root/jstests/core/create_indexes.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/create_indexes.js')
-rw-r--r--jstests/core/create_indexes.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/jstests/core/create_indexes.js b/jstests/core/create_indexes.js
index bdb0561094a..afa9db6a93b 100644
--- a/jstests/core/create_indexes.js
+++ b/jstests/core/create_indexes.js
@@ -178,4 +178,10 @@ var configDB = db.getSiblingDB('config');
res =
configDB.runCommand({createIndexes: 'transactions', indexes: [{key: {star: 1}, name: 'star'}]});
assert.commandFailedWithCode(res, ErrorCodes.IllegalOperation);
+
+// Test that providing an empty list of index spec for config.transactions should also fail with
+// IllegalOperation, rather than BadValue for a normal collection.
+// This is consistent with server behavior prior to 6.0.
+res = configDB.runCommand({createIndexes: 'transactions', indexes: []});
+assert.commandFailedWithCode(res, ErrorCodes.IllegalOperation);
}());