diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-03-19 14:00:46 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-03-19 14:00:46 -0400 |
commit | a1da8961abc17cef7564d42ca1b95c0ba8b45fa5 (patch) | |
tree | 893d0548498225b5e8731e6ce2b4147c2fb49524 /jstests/geo_box2.js | |
parent | fc5ec754da83f740c8e14dcd7ce3239272b3094a (diff) | |
download | mongo-a1da8961abc17cef7564d42ca1b95c0ba8b45fa5.tar.gz |
fix $box corner cases SERVER-791
Diffstat (limited to 'jstests/geo_box2.js')
-rw-r--r-- | jstests/geo_box2.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/jstests/geo_box2.js b/jstests/geo_box2.js new file mode 100644 index 00000000000..2aa65d0ccb0 --- /dev/null +++ b/jstests/geo_box2.js @@ -0,0 +1,19 @@ + +t = db.geo_box2; + +t.drop() + +for (i=1; i<10; i++) { + for(j=1; j<10; j++) { + t.insert({loc : [i,j]}); + } +} + +t.ensureIndex({"loc" : "2d"} ) +assert.eq( 9 , t.find({loc : {$within : {$box : [[4,4],[6,6]]}}}).itcount() , "A1" ); + +t.dropIndex( { "loc" : "2d" } ) + +t.ensureIndex({"loc" : "2d"} , {"min" : 0, "max" : 10}) +assert.eq( 9 , t.find({loc : {$within : {$box : [[4,4],[6,6]]}}}).itcount() , "B1" ); + |