diff options
author | Rishab Joshi <rishab.joshi@mongodb.com> | 2020-11-17 13:45:05 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-11-17 14:23:10 +0000 |
commit | 4329ffafa3ef2f9ea40b7ff17a6af8604720de12 (patch) | |
tree | 44cad61cfcdb57abccc910e49fa20f4c6fcc81f2 /jstests/sharding/mongos_validate_writes.js | |
parent | 519bc2b24ecc6c29f2483c8b82786e16f61c2cba (diff) | |
download | mongo-4329ffafa3ef2f9ea40b7ff17a6af8604720de12.tar.gz |
SERVER-50442 Remove ensureIndex shell function
This commit replaces all the usages of ensureIndex() with createIndex() in JS tests and JS shell""
Diffstat (limited to 'jstests/sharding/mongos_validate_writes.js')
-rw-r--r-- | jstests/sharding/mongos_validate_writes.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/jstests/sharding/mongos_validate_writes.js b/jstests/sharding/mongos_validate_writes.js index fbcd98249f6..0852dccf763 100644 --- a/jstests/sharding/mongos_validate_writes.js +++ b/jstests/sharding/mongos_validate_writes.js @@ -19,7 +19,7 @@ var staleCollB = staleMongosB.getCollection(coll + ""); assert.commandWorked(admin.runCommand({enableSharding: coll.getDB() + ""})); st.ensurePrimaryShard(coll.getDB().getName(), st.shard1.shardName); -coll.ensureIndex({a: 1}); +coll.createIndex({a: 1}); // Shard the collection on {a: 1} and move one chunk to another shard. Updates need to be across // two shards to trigger an error, otherwise they are versioned and will succeed after raising @@ -32,7 +32,7 @@ staleCollB.findOne(); // Change the collection sharding state coll.drop(); -coll.ensureIndex({b: 1}); +coll.createIndex({b: 1}); st.shardColl(coll, {b: 1}, {b: 0}, {b: 1}, coll.getDB(), true); // Make sure that we can successfully insert, even though we have stale state @@ -40,7 +40,7 @@ assert.commandWorked(staleCollA.insert({b: "b"})); // Change the collection sharding state coll.drop(); -coll.ensureIndex({c: 1}); +coll.createIndex({c: 1}); st.shardColl(coll, {c: 1}, {c: 0}, {c: 1}, coll.getDB(), true); // Make sure we can successfully upsert, even though we have stale state @@ -52,7 +52,7 @@ assert.commandFailedWithCode(staleCollB.update({b: "b"}, {b: "b"}, true), // Change the collection sharding state coll.drop(); -coll.ensureIndex({d: 1}); +coll.createIndex({d: 1}); st.shardColl(coll, {d: 1}, {d: 0}, {d: 1}, coll.getDB(), true); // Make sure we can successfully update, even though we have stale state @@ -68,7 +68,7 @@ assert.eq(staleCollB.findOne().x, "x"); // Change the collection sharding state coll.drop(); -coll.ensureIndex({e: 1}); +coll.createIndex({e: 1}); // Deletes need to be across two shards to trigger an error. st.ensurePrimaryShard(coll.getDB().getName(), st.shard0.shardName); st.shardColl(coll, {e: 1}, {e: 0}, {e: 1}, coll.getDB(), true); |