mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 09:06:21 +01:00
or4.js
This commit is contained in:
parent
51c11bc0ce
commit
4af35d0033
@ -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 );
|
||||
assert.eq( 3, t.find( {$or:[{a:2},{b:3}]} ).toArray().length );
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user