summaryrefslogtreecommitdiff
path: root/jstests/core/geo_s2largewithin.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/geo_s2largewithin.js')
-rw-r--r--jstests/core/geo_s2largewithin.js27
1 files changed, 9 insertions, 18 deletions
diff --git a/jstests/core/geo_s2largewithin.js b/jstests/core/geo_s2largewithin.js
index bd4ccafdae1..2bb0fb557b2 100644
--- a/jstests/core/geo_s2largewithin.js
+++ b/jstests/core/geo_s2largewithin.js
@@ -2,42 +2,33 @@
// doesn't take forever.
t = db.geo_s2largewithin;
t.drop();
-t.ensureIndex( { geo : "2dsphere" } );
+t.ensureIndex({geo: "2dsphere"});
testPoint = {
name: "origin",
- geo: {
- type: "Point",
- coordinates: [0.0, 0.0]
- }
+ geo: {type: "Point", coordinates: [0.0, 0.0]}
};
testHorizLine = {
name: "horiz",
- geo: {
- type: "LineString",
- coordinates: [[-2.0, 10.0], [2.0, 10.0]]
- }
+ geo: {type: "LineString", coordinates: [[-2.0, 10.0], [2.0, 10.0]]}
};
testVertLine = {
name: "vert",
- geo: {
- type: "LineString",
- coordinates: [[10.0, -2.0], [10.0, 2.0]]
- }
+ geo: {type: "LineString", coordinates: [[10.0, -2.0], [10.0, 2.0]]}
};
t.insert(testPoint);
t.insert(testHorizLine);
t.insert(testVertLine);
-//Test a poly that runs horizontally along the equator.
+// Test a poly that runs horizontally along the equator.
-longPoly = {type: "Polygon",
- coordinates: [
- [[30.0, 1.0], [-30.0, 1.0], [-30.0, -1.0], [30.0, -1.0], [30.0, 1.0]]
- ]};
+longPoly = {
+ type: "Polygon",
+ coordinates: [[[30.0, 1.0], [-30.0, 1.0], [-30.0, -1.0], [30.0, -1.0], [30.0, 1.0]]]
+};
result = t.find({geo: {$geoWithin: {$geometry: longPoly}}});
assert.eq(result.itcount(), 1);