Files
mongo/jstests/core/create_index_helper_validation.js
Rishab Joshi 4329ffafa3 SERVER-50442 Remove ensureIndex shell function
This commit replaces all the usages of ensureIndex() with createIndex() in JS tests and JS shell""
2020-11-17 14:23:10 +00:00

29 lines
894 B
JavaScript

// Tests that helper functions for creating indexes check the number of arguments passed.
(function() {
"use strict";
const coll = db.create_index_helper_validation;
coll.drop();
assert.throws(() => coll.createIndexes(
/* keys */[{a: 1}],
/* options */ {},
/* commitQuorum */ "majority",
{background: true},
{unique: true}));
assert.throws(() => coll.createIndex(
/* keys */ {a: 1},
/* options */ {},
/* commitQuorum */ "majority",
{background: true},
{unique: true}));
assert.throws(() => coll.createIndex(
/* keys */ {a: 1},
/* options */ {},
/* commitQuorum */ "majority",
{background: true},
{unique: true}));
}());