diff options
Diffstat (limited to 'jstests/core/orb.js')
-rw-r--r-- | jstests/core/orb.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/jstests/core/orb.js b/jstests/core/orb.js new file mode 100644 index 00000000000..a4abdeecabf --- /dev/null +++ b/jstests/core/orb.js @@ -0,0 +1,17 @@ +// check neg direction index and negation + +var t = db.jstests_orb; +t.drop(); + +t.save( {a:1} ); +t.ensureIndex( {a:-1} ); + +assert.eq.automsg( "1", "t.count( {$or: [ { a: { $gt:0,$lt:2 } }, { a: { $gt:-1,$lt:3 } } ] } )" ); + +t.drop(); + +t.save( {a:1,b:1} ); +t.ensureIndex( {a:1,b:-1} ); + +assert.eq.automsg( "1", "t.count( {$or: [ { a: { $gt:0,$lt:2 } }, { a: { $gt:-1,$lt:3 } } ] } )" ); +assert.eq.automsg( "1", "t.count( {$or: [ { a:1, b: { $gt:0,$lt:2 } }, { a:1, b: { $gt:-1,$lt:3 } } ] } )" );
\ No newline at end of file |