summaryrefslogtreecommitdiff
path: root/jstests/core/geo_array0.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/geo_array0.js')
-rw-r--r--jstests/core/geo_array0.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/jstests/core/geo_array0.js b/jstests/core/geo_array0.js
index c83223cef05..42b9c758e45 100644
--- a/jstests/core/geo_array0.js
+++ b/jstests/core/geo_array0.js
@@ -3,24 +3,24 @@ t = db.geoarray;
function test(index) {
t.drop();
- t.insert( { zip : "10001", loc : [[ 10, 10 ], [ 50, 50 ]] } );
- t.insert( { zip : "10002", loc : [[ 20, 20 ], [ 50, 50 ]] } );
- var res = t.insert( { zip : "10003", loc : [[ 30, 30 ], [ 50, 50 ]] } );
- assert.writeOK( res );
+ t.insert({zip: "10001", loc: [[10, 10], [50, 50]]});
+ t.insert({zip: "10002", loc: [[20, 20], [50, 50]]});
+ var res = t.insert({zip: "10003", loc: [[30, 30], [50, 50]]});
+ assert.writeOK(res);
if (index) {
- assert.commandWorked(t.ensureIndex( { loc : "2d", zip : 1 } ));
- assert.eq( 2, t.getIndexKeys().length );
+ assert.commandWorked(t.ensureIndex({loc: "2d", zip: 1}));
+ assert.eq(2, t.getIndexKeys().length);
}
- res = t.insert( { zip : "10004", loc : [[ 40, 40 ], [ 50, 50 ]] } );
- assert.writeOK( res );
+ res = t.insert({zip: "10004", loc: [[40, 40], [50, 50]]});
+ assert.writeOK(res);
// test normal access
- printjson( t.find( { loc : { $within : { $box : [ [ 0, 0 ], [ 45, 45 ] ] } } } ).toArray() );
- assert.eq( 4, t.find( { loc : { $within : { $box : [ [ 0, 0 ], [ 45, 45 ] ] } } } ).count() );
- assert.eq( 4, t.find( { loc : { $within : { $box : [ [ 45, 45 ], [ 50, 50 ] ] } } } ).count() );
+ printjson(t.find({loc: {$within: {$box: [[0, 0], [45, 45]]}}}).toArray());
+ assert.eq(4, t.find({loc: {$within: {$box: [[0, 0], [45, 45]]}}}).count());
+ assert.eq(4, t.find({loc: {$within: {$box: [[45, 45], [50, 50]]}}}).count());
}
-//test(false); // this was removed as part of SERVER-6400
+// test(false); // this was removed as part of SERVER-6400
test(true);