summaryrefslogtreecommitdiff
path: root/jstests/core
diff options
context:
space:
mode:
authorGreg Studer <greg@10gen.com>2014-08-21 17:19:57 -0400
committerSiyuan Zhou <siyuan.zhou@mongodb.com>2014-09-18 17:33:39 -0400
commit1eaf5a41ba94c5787e72fe92ef4a91ac63f6a744 (patch)
treee9a22de1470823848e84200f933f19344a9ec744 /jstests/core
parentc7ee53ba9bf48dd958baa4cbc45ec5d6f3683072 (diff)
downloadmongo-1eaf5a41ba94c5787e72fe92ef4a91ac63f6a744.tar.gz
SERVER-14981 don't generate cell ids > coarsestIndexedLevel when building covering
(cherry picked from commit 6e90ddf91fdbbc578e499fcb736365498e47f55a) Conflicts: src/mongo/db/query/expression_index.cpp
Diffstat (limited to 'jstests/core')
-rwxr-xr-xjstests/core/geo_s2index.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/jstests/core/geo_s2index.js b/jstests/core/geo_s2index.js
index 11d86a3bf2f..60a3e795e3d 100755
--- a/jstests/core/geo_s2index.js
+++ b/jstests/core/geo_s2index.js
@@ -69,7 +69,7 @@ t.save({loc: [0,0]})
assert.throws(function() { return t.count({loc: {$foo:[0,0]}}) })
assert.throws(function() { return t.find({ "nonGeo": "pointA",
"geo" : { "$geoIntersects" : { "$geometry" : somepoly},
- "$near": {"$geometry" : somepoly }}}).count()})
+ "$near": {"$geometry" : somepoly }}}).count()})
// If we specify a datum, it has to be valid (WGS84).
t.drop()
@@ -97,6 +97,9 @@ t.drop();
t.save({loc: [0,0]})
res = t.ensureIndex({ loc: "2dsphere" }, { finestIndexedLevel: 17, coarsestIndexedLevel: 5 });
assert.commandWorked(res);
+// Ensure the index actually works at a basic level
+assert.neq(null,
+ t.findOne({ loc : { $geoNear : { $geometry : { type: 'Point', coordinates: [0, 0] } } } }));
t.drop();
t.save({loc: [0,0]})
@@ -107,6 +110,9 @@ t.drop();
t.save({loc: [0,0]})
res = t.ensureIndex({ loc: "2dsphere" }, { finestIndexedLevel: 30, coarsestIndexedLevel: 0 });
assert.commandWorked(res);
+//Ensure the index actually works at a basic level
+assert.neq(null,
+ t.findOne({ loc : { $geoNear : { $geometry : { type: 'Point', coordinates: [0, 0] } } } }));
t.drop();
t.save({loc: [0,0]})