0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 09:06:21 +01:00
This commit is contained in:
Dwight 2010-05-19 14:57:27 -04:00
parent 51c11bc0ce
commit 4af35d0033

View File

@ -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}]} );
assert.eq( 0, t.count() );
t.remove({ $or: [{ a: 2 }, { b: 3}] });
print("count:" + t.count());
assert.eq( 0, t.count(), 'count' );
t.save( {a:2} );
t.save( {b:3} );
@ -22,3 +25,6 @@ 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 );