diff options
author | Aaron <aaron@10gen.com> | 2010-06-07 12:18:00 -0700 |
---|---|---|
committer | Aaron <aaron@10gen.com> | 2010-06-07 12:18:00 -0700 |
commit | 8680389bba5b0ea56556957fd2f7e99fc467b1d2 (patch) | |
tree | 1429759badfa0f0026950c319767d28a38ef7d7c /jstests/or5.js | |
parent | d4256a4c9bc6ad1210c5214501ddb3d139fbdd38 (diff) | |
download | mongo-8680389bba5b0ea56556957fd2f7e99fc467b1d2.tar.gz |
SERVER-109 sort and geo
Diffstat (limited to 'jstests/or5.js')
-rw-r--r-- | jstests/or5.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/jstests/or5.js b/jstests/or5.js index 6261316647a..45aaa44ada1 100644 --- a/jstests/or5.js +++ b/jstests/or5.js @@ -6,3 +6,16 @@ t.ensureIndex( {b:1} ); assert.eq.automsg( "'BasicCursor'", "t.find( {$or:[{a:2},{b:3},{}]} ).explain().cursor" ); assert.eq.automsg( "'BasicCursor'", "t.find( {$or:[{a:2},{b:3},{c:4}]} ).explain().cursor" ); +assert.eq.automsg( "'BasicCursor'", "t.find( {$or:[{a:2},{b:3}]} ).sort( {c:1} ).explain().cursor" ); +e = t.find( {$or:[{a:2},{b:3}]} ).sort( {a:1} ).explain(); +assert.eq.automsg( "'BtreeCursor a_1'", "e.cursor" ); +assert.eq.automsg( "1", "e.indexBounds[ 0 ][ 0 ].a.$minElement" ); +assert.eq.automsg( "1", "e.indexBounds[ 0 ][ 1 ].a.$maxElement" ); + +t.ensureIndex( {z:"2d"} ); + +assert.eq.automsg( "'GeoSearchCursor'", "t.find( {z:{$near:[50,50]},a:2} ).explain().cursor" ); +assert.eq.automsg( "'GeoSearchCursor'", "t.find( {z:{$near:[50,50]},$or:[{a:2}]} ).explain().cursor" ); +assert.eq.automsg( "'GeoSearchCursor'", "t.find( {$or:[{a:2}],z:{$near:[50,50]}} ).explain().cursor" ); +assert.eq.automsg( "'GeoSearchCursor'", "t.find( {$or:[{a:2},{b:3}],z:{$near:[50,50]}} ).explain().cursor" ); +assert.throws.automsg( function() { return t.find( {$or:[{z:{$near:[50,50]}},{a:2}]} ).toArray(); } ); |