summaryrefslogtreecommitdiff
path: root/jstests/core/geo_oob_sphere.js
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2016-03-09 12:17:50 -0500
committerJonathan Abrahams <jonathan@mongodb.com>2016-03-09 12:18:14 -0500
commit4ae691e8edc87d0e3cfb633bb91c328426be007b (patch)
tree52079a593f54382ca13a2e741633eab1b6271893 /jstests/core/geo_oob_sphere.js
parenta025d43f3ce2efc1fb1282a718f5d286fa0a4dc1 (diff)
downloadmongo-4ae691e8edc87d0e3cfb633bb91c328426be007b.tar.gz
SERVER-22468 Format JS code with approved style in jstests/
Diffstat (limited to 'jstests/core/geo_oob_sphere.js')
-rw-r--r--jstests/core/geo_oob_sphere.js37
1 files changed, 22 insertions, 15 deletions
diff --git a/jstests/core/geo_oob_sphere.js b/jstests/core/geo_oob_sphere.js
index 7403cc99610..40249766355 100644
--- a/jstests/core/geo_oob_sphere.js
+++ b/jstests/core/geo_oob_sphere.js
@@ -5,29 +5,36 @@
t = db.geooobsphere;
t.drop();
-t.insert({ loc : { x : 30, y : 89 } });
-t.insert({ loc : { x : 30, y : 89 } });
-t.insert({ loc : { x : 30, y : 89 } });
-t.insert({ loc : { x : 30, y : 89 } });
-t.insert({ loc : { x : 30, y : 89 } });
-t.insert({ loc : { x : 30, y : 89 } });
-t.insert({ loc : { x : 30, y : 91 } });
+t.insert({loc: {x: 30, y: 89}});
+t.insert({loc: {x: 30, y: 89}});
+t.insert({loc: {x: 30, y: 89}});
+t.insert({loc: {x: 30, y: 89}});
+t.insert({loc: {x: 30, y: 89}});
+t.insert({loc: {x: 30, y: 89}});
+t.insert({loc: {x: 30, y: 91}});
-assert.commandWorked(t.ensureIndex({ loc : "2d" }));
+assert.commandWorked(t.ensureIndex({loc: "2d"}));
-assert.throws( function() { t.find({ loc : { $nearSphere : [ 30, 91 ], $maxDistance : 0.25 } }).count(); } );
+assert.throws(function() {
+ t.find({loc: {$nearSphere: [30, 91], $maxDistance: 0.25}}).count();
+});
// TODO: SERVER-9986 - it's not clear that throwing is correct behavior here
-// assert.throws( function() { t.find({ loc : { $nearSphere : [ 30, 89 ], $maxDistance : 0.25 } }).count() } );
+// assert.throws( function() { t.find({ loc : { $nearSphere : [ 30, 89 ], $maxDistance : 0.25 }
+// }).count() } );
-assert.throws( function() { t.find({ loc : { $within : { $centerSphere : [[ -180, -91 ], 0.25] } } }).count(); } );
+assert.throws(function() {
+ t.find({loc: {$within: {$centerSphere: [[-180, -91], 0.25]}}}).count();
+});
var res;
-res = db.runCommand({ geoNear : "geooobsphere", near : [179, -91], maxDistance : 0.25, spherical : true });
-assert.commandFailed( res );
-printjson( res );
+res =
+ db.runCommand({geoNear: "geooobsphere", near: [179, -91], maxDistance: 0.25, spherical: true});
+assert.commandFailed(res);
+printjson(res);
// TODO: SERVER-9986 - it's not clear that throwing is correct behavior here
-// res = db.runCommand({ geoNear : "geooobsphere", near : [30, 89], maxDistance : 0.25, spherical : true })
+// res = db.runCommand({ geoNear : "geooobsphere", near : [30, 89], maxDistance : 0.25, spherical :
+// true })
// assert.commandFailed( res )
// printjson( res )