summaryrefslogtreecommitdiff
path: root/jstests/libs/create_index_txn_helpers.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/libs/create_index_txn_helpers.js')
-rw-r--r--jstests/libs/create_index_txn_helpers.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/jstests/libs/create_index_txn_helpers.js b/jstests/libs/create_index_txn_helpers.js
index c9b239fa80b..33b98a5f069 100644
--- a/jstests/libs/create_index_txn_helpers.js
+++ b/jstests/libs/create_index_txn_helpers.js
@@ -11,13 +11,17 @@ const conflictingIndexSpecs = {
name: "a_1"
};
-const createIndexAndCRUDInTxn = function(sessionDB, collName, explicitCollCreate) {
+const createIndexAndCRUDInTxn = function(sessionDB, collName, explicitCollCreate, multikeyIndex) {
if (explicitCollCreate) {
assert.commandWorked(sessionDB.runCommand({create: collName}));
}
let sessionColl = sessionDB[collName];
assert.commandWorked(sessionColl.runCommand({createIndexes: collName, indexes: [indexSpecs]}));
- assert.commandWorked(sessionColl.insert({a: 1}));
+ if (multikeyIndex) {
+ assert.commandWorked(sessionColl.insert({a: [1, 2, 3]}));
+ } else {
+ assert.commandWorked(sessionColl.insert({a: 1}));
+ }
assert.eq(sessionColl.find({a: 1}).itcount(), 1);
assert.eq(sessionColl.find({}).itcount(), 1);
};