summaryrefslogtreecommitdiff
path: root/jstests/perf
diff options
context:
space:
mode:
authorRishab Joshi <rishab.joshi@mongodb.com>2020-11-10 13:42:25 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-11-12 10:38:50 +0000
commite69c967ff8b53634770438dfe9a5c7d13548351b (patch)
treecf8f6b10b2374f388d51213d172f28b4fd3d05e8 /jstests/perf
parent916c466afac10d34e61b6ca42a12e35d7c4828f1 (diff)
downloadmongo-e69c967ff8b53634770438dfe9a5c7d13548351b.tar.gz
SERVER-50442 Remove ensureIndex shell function This commit also replaces all the usages of ensureIndex() with createIndex() in JS tests and JS shell
Diffstat (limited to 'jstests/perf')
-rw-r--r--jstests/perf/compact_speed_test.js6
-rw-r--r--jstests/perf/find1.js2
-rw-r--r--jstests/perf/index1.js4
-rw-r--r--jstests/perf/remove1.js2
4 files changed, 7 insertions, 7 deletions
diff --git a/jstests/perf/compact_speed_test.js b/jstests/perf/compact_speed_test.js
index b8fbfd2dc4a..5f1566a5967 100644
--- a/jstests/perf/compact_speed_test.js
+++ b/jstests/perf/compact_speed_test.js
@@ -29,11 +29,11 @@ if (1) {
var a = timed();
// print("index");
- t.ensureIndex({x: 1});
+ t.createIndex({x: 1});
// print("index");
- t.ensureIndex({y: 1});
+ t.createIndex({y: 1});
// print("index");
- t.ensureIndex({z: 1});
+ t.createIndex({z: 1});
a += timed();
diff --git a/jstests/perf/find1.js b/jstests/perf/find1.js
index 6a9d3b75355..31710cbfd66 100644
--- a/jstests/perf/find1.js
+++ b/jstests/perf/find1.js
@@ -13,7 +13,7 @@ function testSetup(dbConn) {
for (var i = 0; i < size; i++) {
t.save({num: i});
if (i == 0)
- t.ensureIndex({num: 1});
+ t.createIndex({num: 1});
}
}
diff --git a/jstests/perf/index1.js b/jstests/perf/index1.js
index ecb749069b9..04b71680e66 100644
--- a/jstests/perf/index1.js
+++ b/jstests/perf/index1.js
@@ -12,11 +12,11 @@ printjson(db.serverStatus().mem);
for (var i = 0; i < 5; i++) {
nonu = Date.timeFunc(function() {
- t.ensureIndex({x: 1});
+ t.createIndex({x: 1});
});
t.dropIndex({x: 1});
u = Date.timeFunc(function() {
- t.ensureIndex({x: 1}, {unique: 1});
+ t.createIndex({x: 1}, {unique: 1});
});
t.dropIndex({x: 1});
print("non unique: " + nonu + " unique: " + u);
diff --git a/jstests/perf/remove1.js b/jstests/perf/remove1.js
index 09f1948572b..a7bf7bc1faa 100644
--- a/jstests/perf/remove1.js
+++ b/jstests/perf/remove1.js
@@ -10,7 +10,7 @@ var msg = "Hello from remove test";
function testSetup(dbConn) {
var t = dbConn[collection_name];
t.drop();
- t.ensureIndex({num: 1});
+ t.createIndex({num: 1});
for (var i = 0; i < size; i++) {
t.save({num: i, msg: msg});