diff --git a/jstests/or4.js b/jstests/or4.js index db566c4c61b..956adb32a81 100644 --- a/jstests/or4.js +++ b/jstests/or4.js @@ -8,11 +8,14 @@ t.save( {a:2} ); t.save( {b:3} ); t.save( {a:2,b:3} ); -assert.eq( 3, t.count( {$or:[{a:2},{b:3}]} ) ); -assert.eq( 2, t.count( {$or:[{a:2},{a:2}]} ) ); +assert.eq( 3, t.count( {$or:[{a:2},{b:3}]} ), 'a' ); +assert.eq( 2, t.count( {$or:[{a:2},{a:2}]} ), 'b' ); + +t.remove({ $or: [{ a: 2 }, { b: 3}] }); + +print("count:" + t.count()); -t.remove( {$or:[{a:2},{b:3}]} ); -assert.eq( 0, t.count() ); +assert.eq( 0, t.count(), 'count' ); t.save( {a:2} ); t.save( {b:3} ); @@ -21,4 +24,7 @@ t.save( {a:2,b:3} ); t.update( {$or:[{a:2},{b:3}]}, {$set:{z:1}}, false, true ); assert.eq( 3, t.count( {z:1} ) ); -assert.eq( 3, t.find( {$or:[{a:2},{b:3}]} ).toArray().length ); \ No newline at end of file +assert.eq( 3, t.find( {$or:[{a:2},{b:3}]} ).toArray().length ); + + +