Files
mongo/jstests/core/index3.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

19 lines
359 B
JavaScript

// Cannot implicitly shard accessed collections because of extra shard key index in sharded
// collection.
// @tags: [assumes_no_implicit_index_creation]
t = db.index3;
t.drop();
assert(t.getIndexes().length == 0);
t.createIndex({name: 1});
t.save({name: "a"});
t.createIndex({name: 1});
assert(t.getIndexes().length == 2);
assert(t.validate().valid);