summaryrefslogtreecommitdiff
path: root/jstests/sharding/mongos_validate_writes.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/sharding/mongos_validate_writes.js')
-rw-r--r--jstests/sharding/mongos_validate_writes.js10
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);