diff options
Diffstat (limited to 'jstests/core/geo_update_dedup.js')
-rw-r--r-- | jstests/core/geo_update_dedup.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/jstests/core/geo_update_dedup.js b/jstests/core/geo_update_dedup.js index 34e9aff30dd..3938204c70e 100644 --- a/jstests/core/geo_update_dedup.js +++ b/jstests/core/geo_update_dedup.js @@ -13,7 +13,7 @@ var t = db.jstests_geo_update_dedup; // 2d index with $near t.drop(); -t.ensureIndex({locs: "2d"}); +t.createIndex({locs: "2d"}); t.save({locs: [[49.999, 49.999], [50.0, 50.0], [50.001, 50.001]]}); var q = {locs: {$near: [50.0, 50.0]}}; @@ -24,7 +24,7 @@ assert.eq(1, res.nMatched); assert.eq(1, t.findOne().touchCount); t.drop(); -t.ensureIndex({locs: "2d"}); +t.createIndex({locs: "2d"}); t.save({locs: [{x: 49.999, y: 49.999}, {x: 50.0, y: 50.0}, {x: 50.001, y: 50.001}]}); res = t.update({locs: {$near: {x: 50.0, y: 50.0}}}, {$inc: {touchCount: 1}}); assert.eq(1, res.nMatched); @@ -32,7 +32,7 @@ assert.eq(1, t.findOne().touchCount); // 2d index with $within t.drop(); -t.ensureIndex({loc: "2d"}); +t.createIndex({loc: "2d"}); t.save({loc: [[0, 0], [1, 1]]}); res = t.update({loc: {$within: {$center: [[0, 0], 2]}}}, {$inc: {touchCount: 1}}, false, true); @@ -41,7 +41,7 @@ assert.eq(1, t.findOne().touchCount); // 2dsphere index with $geoNear t.drop(); -t.ensureIndex({geo: "2dsphere"}); +t.createIndex({geo: "2dsphere"}); var x = { "type": "Polygon", "coordinates": [[[49.999, 49.999], [50.0, 50.0], [50.001, 50.001], [49.999, 49.999]]] @@ -62,7 +62,7 @@ var locdata = [ {geo: {type: "Point", coordinates: [50.001, 50.001]}} ]; t.save({locdata: locdata, count: 0}); -t.ensureIndex({"locdata.geo": "2dsphere"}); +t.createIndex({"locdata.geo": "2dsphere"}); res = t.update({"locdata.geo": {$geoNear: {"type": "Point", "coordinates": [50.0, 50.0]}}}, {$inc: {touchCount: 1}}, |