summaryrefslogtreecommitdiff
path: root/jstests/core/existsa.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/existsa.js')
-rw-r--r--jstests/core/existsa.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/jstests/core/existsa.js b/jstests/core/existsa.js
index 2b5f70dd77f..d1079310d71 100644
--- a/jstests/core/existsa.js
+++ b/jstests/core/existsa.js
@@ -19,7 +19,7 @@ function setIndex(_indexKeyField) {
indexKeyField = _indexKeyField;
indexKeySpec = {};
indexKeySpec[indexKeyField] = 1;
- coll.createIndex(indexKeySpec, {sparse: true});
+ coll.ensureIndex(indexKeySpec, {sparse: true});
}
setIndex('a');
@@ -106,6 +106,6 @@ assertExistsUnindexed({'a.b': {$elemMatch: {$gt: 0, $not: {$exists: false}}}}, 1
// A non sparse index will not be disallowed.
coll.drop();
assert.commandWorked(coll.insert({}));
-coll.createIndex({a: 1});
+coll.ensureIndex({a: 1});
assert.eq(1, coll.find({a: {$exists: false}}).itcount());
})();