summaryrefslogtreecommitdiff
path: root/jstests/eval4.js
blob: 31d6ef0c2a8c2d2c1fe4e045786633272aca902c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

t = db.eval4;
t.drop();

t.save( { a : 1 } );
t.save( { a : 2 } );
t.save( { a : 3 } );

assert.eq( 3 , t.count() , "A" );

function f( x ){
    db.eval4.remove( { a : x } );
}

f( 2 );
assert.eq( 2 , t.count() , "B" );          

db.eval( f , 2 );
assert.eq( 2 , t.count() , "C" );          

db.eval( f , 3 );
assert.eq( 1 , t.count() , "D" );